m.ac

How to upgrade from Debian 12 Bookworm to Debian 13 Trixie

415 words2 min read

#Introduction

##What is Debian?

Debian 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, /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

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

Restart services during package upgrades without asking

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

Modify the configuration file

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.

How to upgrade from Debian 12 Bookworm to Debian 13 Trixie
Author
Xiufeng Guo
Published
Aug 19, 2025
Last updated
Aug 19, 2025
License
Short link
ADShare it the short way.URL shortener, file and text sharing, link in bio. Run by yours truly.S.EE →
Share