How to upgrade from Debian 12 (Bookworm) to Debian 13 (Trixie)
It has been announced for quite some time and after more than two years, the initial stable version of Debian 13 „Trixie“ has been released today. The impatient ones among us (including me) will surely and instantly search an upgrade path for their Debian 12 „Bookworm“-installations. Here it is!
Fortunately, the way of upgrading is pretty straightforward! This post will lead you through the process step by step so join me on this journey towards Debian 13!
Step 1 - Backup
There should be a backup available (at least one) in the rare case something gets down the drain so make one. Do a snapshot or a manual full backup of your machine. Ensure that you can always revert if the rare case appears that the upgrade won’t work in your specific environment. Remember: You are going to do a complete major system upgrade at your own risk so be prepared and keep the „backup early, backup often“-policy in mind!
Additionally, manually create an archive of your files in /etc, mostly being important configuration files for your current Debian 12-system by using the commands
tar -czf /backup/etc-backup-$(date +%Y%m%d).tar.gz /etc
dpkg --get-selections > /backup/package-selections-$(date +%Y%m%d).txt
This creates compressed backups of the system configuration-files mentioned and installed package list for recovery purposes - hopefully, we won’t need them.
Step 2 - Update the current system
Ensure that your Debian 12-environment is fully patched and that there is nothing new to install or update before the update:
apt update
apt upgrade
apt dist-upgrade
These commands ensure your Bookworm-installation has the latest security updates and package versions.
Step 3 - Clear the package cache
Use the virtual broom and clear your system’s package cache before performing any further steps, ensuring that the virtual trashcan is emptied before heading on!
apt clean
apt autoremove
This removes unnecessary packages and clears cached files to provide adequate space for new packages you may probably need.
Step 4 - Check the system status
Before the upgrade, verifying system integrity is yet another thing you should consider:
apt --fix-broken install
dpkg --configure -a
These commands identify and resolve any existing package management issues that could complicate the upgrade or force it to fail! Mentioning the possibility of failing: Ensure you have at least 5 GB of free disk space on your root partition before beginning the upgrade process! Use „df -h /" to check your available space before proceeding!
Step 5 - Backing up the previous repository settings
Create a safety copy of your current repository settings by typing
cp /etc/apt/sources.list /etc/apt/sources.list.bookworm-backup
cp -r /etc/apt/sources.list.d /etc/apt/sources.list.d.bookworm-backup
This is not a must put it preserves your current repository configuration for a rollback if needed!
Step 6 - Switching to the new repositories
sed -i 's/bookworm/trixie/g' /etc/apt/sources.list
find /etc/apt/sources.list.d -name "*.list" -exec sed -i 's/bookworm/trixie/g' {} \;
This systematically updates all repository references and therefore sources from „Bookworm“ to „Trixie“ across all configuration files. Make sure to manually check the correctness of all sources files to avoid issues further down the track!
Then use
apt update
afterwards to download the latest package lists from the newly configured „Trixie“-repositories which should - depending on your system - be quite a lot.
As for third-party repositories please mind that these may not immediately support Trixie. You may consider temporarily disabling them by adding ‘#’ at the beginning of their lines in sources configuration files. In my case, I didn’t have any problems with the third-party repositories of Node.js or Docker but this depends on your specific environment of course!
Step 7 - Minimal upgrade („safe settings“)
Now, as all preparations have been completed, we can perform a conservative package update. This means that the following command updates existing packages while avoiding potential dependency conflicts from new package installations. You may also skip this step to go „all in“ but I prefer to do this in stages by issuing
apt upgrade --without-new-pkgs
Step 8 - Full distribution upgrade
Here we complete the upgrade progress and do the rest of the magic:
apt full-upgrade
This command handles complex package dependencies, installs new packages and removes obsoleted packages as needed. During the upgrade process you may encounter prompts about service restarts and configuration file updates. Generally, just choose to restart services automatically (even SSH won’t be disconnected here!) and keep your existing configuration files unless you have specific reasons to update them as they contain your individual settings and changes.
The complete upgrade process typically takes some more or less minutes depending on your system specifications, installed base and Internet connection speed. Most of the time, the system will remain functional until specific services are restarted. After all this has happened, you may (but you don’t have to!) reboot the system for the first time - I have chosen to do so:
systemctl reboot

Step 9 - Verifying everything’s up-to-date
There are some commands you may use to check your current Debian-version after doing the serious steps before. Each one of the following three commands should confirm you’re on Debian 13 „Trixie“ now, underlining the successful upgrade:
cat /etc/debian_version
lsb_release -a
cat /etc/os-release

Step 10 - Cleaning out the closet
Heading towards the finishing line in our upgrade from „Bookworm“ to „Trixie“, tidying out the remains of the old system is a necessary „evil“:
apt autoremove
apt autoclean
These commands remove packages that were automatically installed as dependencies but are no longer needed in our new environment. Furthermore, we also need to refresh the system package information to see correct further - new - updates in the future.
apt update
apt list --upgradable
This ensures our system has the latest package information and shows any remaining available updates.
Last but not least, a reboot finally ensures all system services are running with updated configurations and the new kernel is loaded unless you haven’t already rebooted in step 8!
systemctl reboot

Troubleshooting
Among this trip and according to your specific systems, there may be three roadblocks preventing a successful upgrade. All those relay on common dependency issues like:
- Unmet dependencies: Use „apt –fix-broken install“ to resolve automatic dependency resolution
- Held packages: Check for held packages with „apt-mark showhold“ and release holds if safe
- Package conflicts: Remove conflicting packages manually before upgrading by using the „apt remove conflicting-package“-command
These may be showstoppers but can be easily fixed with help of the commands above!
Verdict
We have successfully managed to upgrade a Debian system running iteration 12 „Bookworm“ to the latest version 13 „Trixie“ in just ten (compressed) steps. Although the whole process has been a major release switch, using independent/manual backups for our configuration and repository-files have helped to remain safe and our system is now running on Debian 13 „Trixie“ on the day it was released. Rarely early-adopting felt that good and I hope you can use this tutorial to successfully (and safely) upgrade your system(s), too!