How to Upgrade from Debian 12 Bookworm to Debian 13 Trixie
Learn how to safely upgrade your Debian system from version 12 Bookworm to version 13 Trixie in this step-by-step guide.

Introduction
What is Debian?
Debian is a free and open-source Linux distribution developed by the Debian Project, which was founded by Ian Murdock in August 1993. As one of the oldest operating systems built on the Linux kernel, Debian has served as the foundation for many other Linux distributions.
Debian 13, codenamed "Trixie", is released on August 9, 2025. In this article, I’ll guide you through the steps to upgrade from 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 proceeding, make a full backup of your system!
To begin the upgrade process, I will switch to the root
user by sudo -i
or su root
.
2. Update system
First, we need to update our current Debian 12 system using the following commands:
apt update
apt upgrade -y
apt full-upgrade -y
apt autoclean
apt autoremove -y
If the kernel is updated, you can reboot your server before proceeding with the upgrade to Debian 13 (optional but recommend).
3. Upgrade to Debian 13
First, let’s update the APT sources file by replacing bookworm
with trixie
:
sed -i 's/bookworm/trixie/g' /etc/apt/sources.list
sed -i 's/bookworm/trixie/g' /etc/apt/sources.list.d/*.list
sed -i 's/bookworm/trixie/g' /etc/apt/sources.list.d/*.sources
If the .list
or .sources
files are missing, you may see the following error. However, it can be safely ignored:
sed: can't read /etc/apt/sources.list.d/*.sources: No such file or directory
Your default /etc/apt/sources.list
will then look like this:
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 are using the DEB822 source format, your /etc/apt/sources.list.d/debian.sources
file will look like this:
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, let’s update the system again:
apt update
apt upgrade -y
apt full-upgrade -y
If the apt
command does not include the -y
option for automatic confirmation, the system will prompt you during the update process, for example, to confirm software updates, handle automatic restarts, and more. You can safely select Yes when prompted.
For certain software configuration files, you can choose the option that suits your needs. Pressing Enter will keep the existing configuration file. This usually occurs with packages such as OpenSSH.
When the apt-listchanges: News
interface appears, you can press q to exit.
Restart services during package upgrades without asking:
Modify the configuration file:
After certain software updates, the systemd service configuration may change. In this case, run systemctl daemon-reload
to reload the updated configuration.
Once the update is complete, remove any unnecessary software and dependencies:
apt autoclean
apt autoremove -y
Now, reboot your server using reboot
, and then verify the installed Debian version:
root@debian ~ # cat /etc/debian_version
13.0
root@debian ~ # lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 13 (trixie)
Release: 13
Codename: trixie
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
Congratulations! Your system has been successfully upgraded from Debian 12 to Debian 13 with the latest kernel.
