Debian upgrade cheat sheet
Upgrading from one major Debian version to another (in this case, Debian 12 “Bookworm” to Debian 13 “Trixie”) is a manual process. Debian does not automatically upgrade across major versions to ensure stability.
Prepare the system
Before switching repositories, ensure your current Debian 12 system is completely up to date and clean.
-
Backup your data. Do not skip this. A failed upgrade can render the system unbootable.
-
Update current packages:
sudo apt update sudo apt upgrade sudo apt full-upgrade -
Remove unused packages to minimize conflicts:
sudo apt autoremove -
Reboot if necessary:
sudo systemctl reboot
Update repository sources
You need to tell apt to stop looking at “bookworm” repositories and start
looking at “trixie” ones.
-
Edit the sources list:
sudo vim /etc/apt/sources.listNote
If your system uses the newer format, check inside
/etc/apt/sources.list.d/debian.sourcesinstead. -
Replace codenames:
Change every instance of
bookwormtotrixie.-deb http://deb.debian.org/debian bookworm main -deb-src http://deb.debian.org/debian bookworm main +deb http://deb.debian.org/debian trixie main +deb-src http://deb.debian.org/debian trixie main -deb http://security.debian.org/debian-security bookworm-security main -deb-src http://security.debian.org/debian-security bookworm-security main +deb http://security.debian.org/debian-security trixie-security main +deb-src http://security.debian.org/debian-security trixie-security main -deb http://deb.debian.org/debian bookworm-updates main -deb-src http://deb.debian.org/debian bookworm-updates main +deb http://deb.debian.org/debian trixie-updates main +deb-src http://deb.debian.org/debian trixie-updates mainTip
You can do this automatically with
sed(double-check the file afterwards):sudo sed -i 's/bookworm/trixie/g' /etc/apt/sources.list sudo sed -i 's/bookworm/trixie/g' /etc/apt/sources.list.d/*.list
Perform the upgrade
Now that the sources point to Debian 13, you perform the upgrade in two stages.
-
Update the package lists:
sudo apt update -
Minimal Upgrade (Step 1):
This upgrades packages that can be upgraded without removing anything. It provides a smoother path than jumping straight to full-upgrade.
sudo apt upgrade --without-new-pkgs -
Full Upgrade (Step 2):
This performs the major version upgrade, installing new dependencies and removing conflicting old packages.
sudo apt full-upgradeDuring this process, you will see prompts asking if you want to restart services automatically or keep existing configuration files. Generally, it is safer to keep your existing configuration files (the default option usually “N” or “Keep currently installed version”) unless you know for sure you want the new defaults.
Reboot and clean up
-
Reboot:
sudo systemctl reboot -
Verify Version:
Once back up, check your version:
cat /etc/debian_version -
Clean Up:
Remove the old Debian 12 packages that are no longer needed.
sudo apt autoremove sudo apt clean