Notes from upgrading Debian 12 to 13
Bookworm to trixie on a small server went smoothly overall. These are the steps, plus the one thing that surprised me.
Before you start
- Take a snapshot if your provider offers one. It's the only real undo.
- Bring 12 fully up to date first:
apt update && apt full-upgrade, then reboot. - Run it inside
tmuxorscreen, so a dropped SSH session doesn't kill the upgrade halfway. - Check for leftover packages from other sources:
apt list '?narrow(?installed, ?not(?origin(Debian)))'.
The upgrade
sed -i 's/bookworm/trixie/g' /etc/apt/sources.list /etc/apt/sources.list.d/*
apt update
apt upgrade --without-new-pkgs
apt full-upgrade
reboot
When asked about changed config files, I usually keep my version and then diff against the .dpkg-dist file afterwards.
The surprise: /etc/sysctl.conf
In trixie, /etc/sysctl.conf is no longer read at boot. Settings in it, like net.ipv4.ip_forward=1, silently stop applying after the next reboot. Move them into a drop-in file:
grep -v '^\s*#' /etc/sysctl.conf | grep . > /etc/sysctl.d/99-local.conf
sysctl --system
Check with sysctl net.ipv4.ip_forward after a reboot, not before.
Cleanup
apt autoremove --purge
apt list '~o' # obsolete packages no longer in any repo