---
title: "How to upgrade from Debian 12 Bookworm to Debian 13 Trixie"
tags: ['Debian']
published: 2025-08-19 10:20:49
updated: 2025-08-19 10:27:20
excerpt: "Upgrade a Debian 12 Bookworm system to Debian 13 Trixie without skipping the boring but important parts."
---
> This file is the raw Markdown source of an m.ac post; the canonical version lives at https://m.ac/upgrade-debian-12-to-13/
> The full index of posts and pages is at https://m.ac/llms.txt — read the index first before crawling further.

## Introduction

### What is Debian?

[Debian](https://debian.org/) is a free and open source Linux distribution developed by the Debian Project, which Ian Murdock founded in August 1993. It is one of the oldest Linux distributions still in active use, and plenty of other distributions are built from it.

Debian 13, codenamed "Trixie", was released on August 9, 2025. This guide walks through upgrading Debian 12 "Bookworm" to Debian 13 "Trixie".

---

## 1. Prerequisites

**Important:** Make sure you are running on a dedicated server or a KVM/Xen-based VPS. OpenVZ and LXC are not supported for this upgrade.

**Before you start, make a full backup of your system.**

The following steps require root privileges. The commands use `sudo`, so make sure your user can run it. You can also switch to root with `sudo -i` and remove the `sudo` prefix from the commands.

## 2. Update system

Start by bringing the current Debian 12 system fully up to date:

```bash
sudo apt update
sudo apt upgrade -y
sudo apt full-upgrade -y
sudo apt autoclean
sudo apt autoremove -y
```

If the kernel was updated, reboot before moving on. It is optional, but I recommend doing it anyway.

## 3. Upgrade to Debian 13

Replace `bookworm` with `trixie` in your APT source files:

```bash
sudo sed -i 's/bookworm/trixie/g' /etc/apt/sources.list
sudo sed -i 's/bookworm/trixie/g' /etc/apt/sources.list.d/*.list
sudo sed -i 's/bookworm/trixie/g' /etc/apt/sources.list.d/*.sources
```

If the `.list` or `.sources` files are missing, you may see this error. You can ignore it:

```bash
sed: can't read /etc/apt/sources.list.d/*.sources: No such file or directory
```

Or run the same replacement as one command:

```bash
sudo sed -i 's/bookworm/trixie/g' /etc/apt/sources.list /etc/apt/sources.list.d/*.{list,sources} 2>/dev/null
```

Your default `/etc/apt/sources.list` should then look like this:

```bash
deb https://deb.debian.org/debian trixie main contrib non-free non-free-firmware

deb https://security.debian.org/debian-security trixie-security main contrib non-free non-free-firmware

deb https://deb.debian.org/debian trixie-updates main contrib non-free non-free-firmware
```

If you use the [DEB822 source format](https://repolib.readthedocs.io/en/latest/deb822-format.html), `/etc/apt/sources.list.d/debian.sources` should look like this:

```bash
Types: deb
URIs: https://deb.debian.org/debian
Suites: trixie trixie-updates trixie-backports
Components: main contrib non-free non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

Types: deb
URIs: https://security.debian.org/debian-security
Suites: trixie-security
Components: main contrib non-free non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
```

Now update the package lists and run the upgrade:

```bash
sudo apt update
sudo apt upgrade -y
sudo apt full-upgrade -y
```

If you remove the `-y` option, `apt` will ask before installing updates, restarting services, and making a few other changes. In the normal upgrade path, you can answer **Yes**.

For some configuration files, choose the option that fits your server. Pressing **Enter** usually keeps the existing file. You will often see this with packages such as **OpenSSH**.

When the `apt-listchanges: News` interface appears, you can press **q** to exit.

[![apt-listchanges](https://macdn.net/2025/08/05/image_S2xQK.png)](https://macdn.net/2025/08/05/image_S2xQK.png)

For service restarts during package upgrades, you can choose the option to restart without asking:

[![Restart services during package upgrades without asking](https://macdn.net/2025/08/05/image_CeXju.png)](https://macdn.net/2025/08/05/image_CeXju.png)

When prompted about a modified configuration file, choose whether to keep yours or install the package maintainer's version:

[![Modify the configuration file](https://macdn.net/2025/08/05/image_v7Yk2.png)](https://macdn.net/2025/08/05/image_v7Yk2.png)

Some package updates change systemd service definitions. If you see a warning about that, run `sudo systemctl daemon-reload` to reload the updated configuration.

Once the upgrade is complete, remove packages and dependencies that are no longer needed:

```bash
sudo apt autoclean
sudo apt autoremove -y
```

Reboot with `sudo reboot`, then verify the installed Debian version:

```bash
root@debian ~ # cat /etc/debian_version 
13.0
```

```bash
root@debian ~ # lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 13 (trixie)
Release:	13
Codename:	trixie
```

```bash
root@debian ~ # uname -a
Linux n 6.12.41+deb13-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.41-1 (2025-08-12) x86_64 GNU/Linux
```

That is it. The system is now running Debian 13 with the new kernel.
