Knowledge Base | BlackHOST

How to Upgrade from Debian 12 to Debian 13 (Trixie)

The official Debian team was kind enough to provide a guide on Upgrades from Debian 12, which is designed to cover all possible configurations and edge cases. While this is an excellent resource, we took the liberty of creating a simplified version specifically for standard Debian 12 installations, or what we like to call the “vanilla” Debian setup, which comes with all of our VPS hosting plans.

This guide is for upgrading from Debian 12 to Debian 13. Direct upgrades from Debian 11 are not supported; you must upgrade to Debian 12 before following these instructions.

Pre-Upgrade Checklist

Before you begin the upgrade process, it is critical to complete the following checks to prevent data loss and system damage.

The Upgrade Process

Step 1: Keep your current system updated

In order to minimize package conflicts, first, ensure that you are running Debian 12 and it is fully up-to-date. First, start a screen session and run the following command:

sudo apt update && sudo apt dist-upgrade --autoremove -y

If this results in the installation of a new kernel, please make sure to reboot your system with sudo reboot in order to boot to the latest kernel.

Step 2: Update APT Sources for Debian 13

Next, you will need to reconfigure APT to use Debian 13 trixie repositories instead of Debian 12 bookworm repositories. You can do this manually by changing the contents of /etc/apt/sources.list using your favorite editor, or you can use this one-liner instead:

sudo sed -i 's/bookworm/trixie/g' /etc/apt/sources.list

If your system has some 3rd party repos in /etc/apt/sources.list.d use the oneliner below, considering if the 3-rd party repository has support for trixie:

sudo find /etc/apt/sources.list.d -type f -exec sed -i 's/bookworm/trixie/g' {} \;

Once done, run sudo apt update to get the latest package list.

Step 3: Start the main upgrade

To minimize the risk of various package conflicts, we recommend a two-step upgrade process. In the first step, we will perform a minimal system upgrade, which will upgrade only the packages that can be upgraded without removing or installing any other packages. To do this, run the following command:

sudo apt update && apt upgrade --without-new-pkgs

Once done, we can perform a full system upgrade using:

sudo apt full-upgrade

This will install the newest versions of the packages and their dependencies, which occasionally may prompt you for your input on how to proceed. Once completed, reboot the system using sudo reboot

Post-Upgrade Checkup

After your server reboots, log back in and verify the upgrade using cat /etc/*release*. The output should show your current Debian version to DEBIAN_VERSION_FULL=13.0.

Debian 13 introduces official support for a new, more structured format for APT’s repository sources, known as the deb822 style. This modern format is designed to be more readable and less prone to syntax errors than the traditional single-line format found in /etc/apt/sources.list.

To modernize your sources, simply run the following command:

sudo apt modernize-sources

After running the command, your original /etc/apt/sources.list file will be backed up and left empty. Your system will now use the new /etc/apt/sources.list.d/debian.sources file for all APT operations.

And that is it, congrats, your system runs on Debian 13 now 🎉

Exit mobile version