Upgrade from Debian 12 (bookworm) to Debian 13 (trixie)
Posted on 01 November 2025 by Mino — 2 min
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
- If you are not using sysmon, skip the steps regarding download and installation of new microsoft key.
- Changing the sources for APT should not be difficult even by hand, and don't forget to adjust the 3rd
sedso even some other sources get from debian 12 to debian 13. - Either use
dist-upgradeorfull-upgradeas they are just aliases for each other.- Question about restarting services:
yesin my case - During the upgrade I was prompted for the following changes in used files:
issueandissue.net-Nas I use custom onesapparmorconfigurations - replaced all as some stuff was probably changedsshd_config- I kept mine as I have custom lines there and not much was changedaide- kept installedgrub- downloaded new, as comparison revealed minor change in the default configuration
- Question about restarting services:
- Modernice sources and remove the old ones (check them before removing them please).
- 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.