Upgrade Debian to Latest Version

Complete guide for safely upgrading your Debian 12 (Bookworm) server or desktop to Debian 13 (Trixie), the current stable release.

Important: Major Debian upgrades must always be performed one release at a time without skipping versions (bookworm → trixie, or the current release to the next stable release).

Prerequisites

Step 1: Update Existing System

Before upgrading, make sure your current Debian 12 system is fully up to date:

sudo apt update
sudo apt upgrade
sudo apt full-upgrade
sudo apt --purge autoremove

Step 2: Update APT Sources (bookworm → trixie)

Update your package repositories from bookworm to trixie (checking both /etc/apt/sources.list and /etc/apt/sources.list.d/ such as debian.sources).

  1. Inspect your active APT configuration:

    cat /etc/apt/sources.list
    ls -la /etc/apt/sources.list.d/
  2. Replace all instances of bookworm with trixie in /etc/apt/sources.list (if used) or in /etc/apt/sources.list.d/debian.sources (DEB822 format):

    Classic /etc/apt/sources.list example for Debian 13 (trixie):

    deb https://deb.debian.org/debian trixie main contrib non-free non-free-firmware
    deb https://deb.debian.org/debian trixie-updates main contrib non-free non-free-firmware
    deb https://security.debian.org/debian-security trixie-security main contrib non-free non-free-firmware

    DEB822 /etc/apt/sources.list.d/debian.sources example for Debian 13 (trixie):

    Types: deb
    URIs: https://deb.debian.org/debian
    Suites: trixie trixie-updates
    Components: main contrib non-free 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 contrib non-free non-free-firmware
    Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

    (Note: Both http:// and https:// mirrors work natively, and APT always verifies repository integrity cryptographically using GPG signatures via SecureApt.)

  3. Save and exit (Ctrl + O, Enter, Ctrl + X). Also inspect any third-party files in /etc/apt/sources.list.d/ and update or temporarily comment out old bookworm entries.

Step 3: Run the Upgrade

Important: Do not pass -y (--assume-yes) during major Debian release upgrades. The official Debian Release Notes advise reviewing the package list carefully before confirming so unexpected package removals do not catch you off guard.

  1. Update package lists with the new Debian 13 (trixie) sources:

    sudo apt update
  2. Perform a minimal upgrade first (avoids dependency conflicts):

    sudo apt upgrade --without-new-pkgs
  3. Perform the full distribution upgrade interactively:

    sudo apt full-upgrade

    During this process:

    • Several services will restart.
    • You may be asked whether services should be restarted automatically during library upgrades. Choosing Yes is usually convenient unless critical services require manual coordination.
    • You may be prompted about modified configuration files. If you have not customized a file, choose "Install the package maintainer's version". If you have customized it yourself, choose "Keep your currently-installed version" and review .dpkg-dist differences afterwards.

Step 4: Reboot and Verify

  1. Restart your system:

    sudo reboot
  2. Verify the new version:

    cat /etc/debian_version
    cat /etc/os-release

    /etc/debian_version should show 13.x and /etc/os-release should show VERSION_CODENAME=trixie.

Step 5: Post-Upgrade Cleanup & Modernization

Remove obsolete packages to free up disk space (review the removal list before confirming):

sudo apt --purge autoremove
sudo apt clean

Note two important changes in Debian 13 (trixie):

Troubleshooting

"Firmware missing" errors

Ensure non-free-firmware is included in your APT sources (as shown in Step 2), then run:

sudo apt update && sudo apt install -y firmware-linux

SSH Disconnected

If upgrading a remote server, running sudo reboot is normally safe, but keep out-of-band console access (VNC/KVM/serial) available in case network interface names or firewall configurations change during the upgrade.

User