Debian

How to upgrade a Debian 12 bookworm server to Debian 13 trixie, step by step

A server-focused walk-through of the official bookworm-to-trixie upgrade: preparation, the new deb822 sources file, the two-stage upgrade and changes to check.

Published
Reading time
6 min read

Debian 13 "trixie" has been the stable release since 9 August 2025, and Debian 12 "bookworm" has been under Long Term Support since July 2026. Upgrading in place is supported and usually uneventful, provided you prepare. This guide follows the official trixie release notes and highlights the changes that matter on servers. Read the release notes yourself as well; they are the authority.

Before you start

Only bookworm can be upgraded to trixie. The release notes state that skipping releases is explicitly not supported. A Debian 11 machine must go to 12 first.

Back up. Besides your data and databases, the release notes name /etc, /var/lib/dpkg, /var/lib/apt/extended_states and the package selection list. If your platform offers snapshots, take one too.

sudo tar czf /root/pre-trixie-$(date +%F).tar.gz /etc /var/lib/dpkg /var/lib/apt/extended_states
dpkg --get-selections '*' > ~/selections-$(date +%F).txt

Plan for remote access problems. Run the upgrade inside screen or tmux and have console access ready. The release notes warn that an interrupted upgrade over SSH could leave a system unreachable with older bookworm OpenSSH; they ask for openssh-server 1:9.2p1-2+deb12u7 or later first. A fully updated bookworm already has a newer version.

Step 1: bring bookworm fully up to date

sudo apt update
sudo apt full-upgrade
sudo reboot

Then check that the package database is clean and nothing is held:

sudo dpkg --audit
apt-mark showhold
cat /etc/debian_version

The last command should show 12.x (12.15 is the final bookworm point release).

Step 2: check space and third-party sources

df -h / /boot /var
sudo apt -o APT::Get::Trivial-Only=true full-upgrade

If /boot is a separate partition, the release notes ask for at least 768 MB with about 300 MB free; systems first installed with Debian 10 or older are very likely too small. Disable third-party repositories (PHP, Docker, database vendors) until you have confirmed they publish trixie packages, and remove APT pinning you no longer need.

Step 3: switch APT to trixie

Trixie moves APT to the deb822 .sources format. The release notes recommend replacing /etc/apt/sources.list and any *.list files with a single /etc/apt/sources.list.d/debian.sources. Their example for main plus non-free-firmware is:

Types: deb
URIs: https://deb.debian.org/debian
Suites: trixie trixie-updates
Components: main non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

Types: deb
URIs: https://security.debian.org/debian-security
Suites: trixie-security
Components: main non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

Add contrib or non-free if you use them, and remove or comment out the old bookworm entries so APT does not see both releases.

Step 4: upgrade in two stages

sudo apt update
sudo apt upgrade --without-new-pkgs
sudo apt full-upgrade

The minimal stage first avoids a full upgrade removing packages you want to keep. Read every configuration-file prompt: keeping your version is usually right for files you edited, but compare with the new default afterwards. APT logs everything in /var/log/apt/history.log and /var/log/apt/term.log.

Step 5: checks before the reboot

  • Network interface names. The release notes list two known cases where trixie names a network interface differently (the i40e driver, and firmware exposing the ACPI _SUN object). Before rebooting, run udevadm test-builtin net_setup_link /sys/class/net/<interface> and compare ID_NET_NAME with the current name. If it differs, pin the name with a systemd .link file or fix the network configuration, or the server may come back without network.
  • Kernel. Make sure a linux-image-* metapackage such as linux-image-amd64 is installed so the trixie 6.12 kernel is pulled in.
dpkg -l 'linux-image*' | grep ^ii | grep -i meta
sudo reboot

After the reboot, cat /etc/debian_version should show 13.x and uname -r a 6.12 kernel.

Server changes worth knowing

  • /tmp is a tmpfs (in memory, up to 50% of RAM by default) after the first reboot. Files left in the old /tmp are hidden. Applications that write large temporary files may need systemctl edit tmp.mount to set a size, or systemctl mask tmp.mount to keep the old behaviour.
  • /etc/sysctl.conf is no longer read. Move kernel tuning into /etc/sysctl.d/*.conf files.
  • OpenSSH dropped DSA keys, and openssh-server no longer reads ~/.pam_environment.
  • Databases change major version. MariaDB moves from 10.11 to 11.8; the release notes stress stopping it cleanly before the upgrade (service mariadb stop, then look for "Shutdown complete" in the log). Bookworm's PostgreSQL 15 is replaced by 17; plan the cluster migration (for example with pg_upgradecluster from postgresql-common) and test it.
  • PHP moves from 8.2 to 8.4. Test applications, extensions and PHP-FPM pool files before upgrading production.
  • Dovecot, Samba, libvirt, RabbitMQ and strongSwan all have specific notes in the issues chapter; read them if you run these.
  • arm64 cloud VMs with UEFI boot need manual steps described in the release notes.

Step 6: clean up

sudo apt autoremove
sudo apt modernize-sources

apt modernize-sources converts any remaining one-line source files to the new format. The release notes also suggest reviewing packages that are now obsolete, since security support for them usually ends a year after trixie's release.

What you should do

  • Test the upgrade on a copy or a non-critical server first, including your application and databases.
  • Take backups (and a snapshot if available), and keep console access ready.
  • Follow the order: update bookworm, check, switch sources, upgrade --without-new-pkgs, full-upgrade, check interface names, reboot.
  • After the reboot, verify services, /tmp usage, sysctl settings and logs.
  • Keep the release notes' issues chapter open during the work; it lists the package-specific traps.

Sources

SKYLINE Engineering

@skyline

The engineering team at SKYLINE Industrial Solutions. We publish field-tested guides drawn from real KSA and GCC deployments.

See author profile
SKYLINE engineering services

Need this implemented for you?

Reading is free — building it right takes a team. SKYLINE engineers ship Debian for Aramco vendors, banks, hospitals and government agencies across Saudi Arabia. Talk to us before you start.

Aramco Approved Contractor ISO 9001 · ISO 27001 SAMA CSF aligned NCA ECC ready 247+ KSA clients

Comments

0 total · 0 threads
Be the first to leave a comment.