How to upgrade Debian 11 (bullseye) to 12 (bookworm)

    Prior to upgrading from bullseye, I've found it helpful to install usrmerge.

    apt install usrmerge

    Upgrade the current stretch 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

     

    Point apt to the buster sources.

    sed -e 's/bullseye/bookworm/g' -i /etc/apt/sources.list 

     

    Perform the upgrade, downloading packages in advance.

    apt update && apt clean && echo OK

    apt upgrade --without-new-pkgs -d -y && echo OK

    apt upgrade --without-new-pkgs -y && 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.