Upgrade from Debian 12 (bookworm) to Debian 13 (trixie)

Posted on 01 November 2025 by Mino 2 min

Upgrade from Debian 12 (bookworm) to Debian 13 (trixie)

Upgrading from debian 12 to debian 13 should be pretty straight forward, and since I upgraded a few of them, I would like to share my notes on it.

Script

sudo -E bash
wget -q https://packages.microsoft.com/config/debian/13/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
yes | sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb

sed -i 's/bookworm/trixie/g' /etc/apt/sources.list
sed -i 's/bookworm/trixie/g' /etc/apt/sources.list.d/*
sed -i 's/debian\/12/debian\/13/g' /etc/apt/sources.list.d/microsoft-prod.list

apt update
apt full-upgrade -y

apt modernize-sources -y

rm /etc/apt/sources.list~ /etc/apt/sources.list.bak /etc/apt/sources.list.d/*.bak

apt update
apt autoclean
apt autoremove -y

reboot

Some notes on the steps above

  1. If you are not using sysmon, skip the steps regarding download and installation of new microsoft key.
  2. Changing the sources for APT should not be difficult even by hand, and don't forget to adjust the 3rd sed so even some other sources get from debian 12 to debian 13.
  3. Either use dist-upgrade or full-upgrade as they are just aliases for each other.
    • Question about restarting services: yes in my case
    • During the upgrade I was prompted for the following changes in used files:
    • issue and issue.net - N as I use custom ones
    • apparmor configurations - replaced all as some stuff was probably changed
    • sshd_config - I kept mine as I have custom lines there and not much was changed
    • aide - kept installed
    • grub - downloaded new, as comparison revealed minor change in the default configuration
  4. Modernice sources and remove the old ones (check them before removing them please).
  5. Remove old/unused packages and reboot, which means you should be good to go.

For more thorough guide please visit original debian guide.


This post was written without the help of AI.