Upgrading Debian 12 to Debian 13
Introduction
Debian 13 was released in August 2025. I don't upgrade my servers right away to new version. I wait a few months and in the meantime tinker with new Debian in virtual machine on my desktop. This helps me to identify, if there are any major bugs in the software that I use in my homelab. In this post I will demonstrate how to upgrade Debian 12 "Bookworm" to Debian 13 "Trixie".
OS used: Debian 12, Debian 13
Prerequisites
It's recommended to have at least 2GB of free space before performing Debian upgrade.
Instructions
The following instructions may include more steps than strictly necessary, but it's to ensure smooth upgrade process and dependency resolution.
-
Update repositories and upgrade current packages to the latest version:
$ sudo apt update && \ sudo apt upgrade -
Upgrade installed packages while also removing packages that are no longer needed:
$ sudo apt full-upgrade -
Clean obsolete and orphaned packages that are no longer needed:
$ sudo apt autoremove --purge && \ sudo apt clean -
Reboot the system:
$ sudo reboot -
Substitute Debian version in
sources.listfrom Debian 12bookwormto Debian 13trixieand print file afterwards to terminal to make sure it was changed correctly:$ sudo sed -i 's/bookworm/trixie/g' /etc/apt/sources.list && \ cat /etc/apt/sources.list-i- edit file in place
's/pattern/replacement/g'- substitute (s) all occurrences of search pattern (g) -
Update repositories and upgrade installed packages with installing new dependencies while also removing packages that are no longer needed:
$ sudo apt update && \ sudo apt full-upgradeDuring the above step, you will be asked to approve changes to configuration files and some service restarts, as the default configurations will be updated by the respective packages. I choose to restart services during package upgrades without asking.
-
Reboot the system:
$ sudo reboot
Note
When upgrading one machine I had a problem where the system didn't assign correct IP address it should receive from DHCP server.
I checked network interface name using command:
$ ip a
Interface name was ens18.
Then I checked network interface name in /etc/network/interfaces file:
$ cat /etc/network/interfaces
Interface name was enp6s18.
The interface names where different, so I changed wrong name in /etc/network/interfaces file to the correct value from ip a command.
-
Clean orphaned packages that are no longer needed:
$ sudo apt autoremove --purge -
Modernize APT repository sources files to the new standard used in Debian:
$ sudo apt modernize-sourcesThis command will create new
.sourcesfiles with repositories configuration, but also keep backup of old files as.list.bak. If everything is working you can delete those old files. -
Some packages may remain after the upgrade, even if a new version was installed during the process. Old packages will be marked as
[installed,local]in the output of a commandapt list --installed. To find and remove these packages use following commands:$ apt list --installed | grep '\[installed,local\]' $ sudo apt remove <package_name_from_command_above> $ sudo apt autoremove --purge
Note
By definition the tag [installed, local] in the output of apt list --installed indicates that the package was installed manually and is not from the official repository. This means it may have been installed from a local .deb file or another source.
In my case when I upgraded some VMs I had for example old kernel from Debian 12 labeled as [installed, local].