How to upgrade Debian 12 (bookworm) to 13 (trixie)

    Upgrade the current bookworm installation to the latest packages.

    apt update && apt upgrade && apt dist-upgrade && apt clean && echo OK

    Perform some cleanup

    apt --purge autoremove
    apt autoclean

     

    Perform database sanity and consistency check.

    dpkg --audit

    Fix any output from this command.Check for any packages which are held back.

    apt-mark showhold

    Record current package status.

    dpkg --get-selections '*' > /root/packages.txt

    Review and remove any obsolete packages

    apt list '?obsolete'
    apt purge '?obsolete'

    Review and remove any obsolete config files

    apt list '?config-files'
    apt purge '?config-files'

    Generate upated SSH key (likely not necessary, check in /etc/ssh/)

    ssh-keygen -t ed25519

    If running MariaDB, shut it down

    service mariadb stop

    Point apt to the trixie sources.

    mv /etc/apt/sources.list /etc/apt/sources.list.debian12
    
    cat << EOF >> /etc/apt/sources.list.d/debian.sources
    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
    EOF
    

     

    Update the package cache.

    apt update && apt clean && echo OK

    Perform the upgrade, downloading packages in advance.

    apt full-upgrade -d -y && echo OK
    apt full-upgrade -y && apt clean && echo OK
    

    Reboot.

    Perform some cleanup

    apt --purge autoremove

    No questions yet.