Upgrade Debian 11 Bullseye to Debian 12 Bookworm
This guide explains how to upgrade Debian Linux from Debian 11 (Bullseye) to Debian 12 (Bookworm), which is the current stable release as of June 10th, 2023.
These steps can be preformed as an in place upgrade on a live system from either a local terminal or remote SSH session.
Prior to upgrading, make sure the current system is up-to-date.
apt update && apt upgrade
Switch the Debian repositories from Bullseye to Bookworm by editing the source file.
Replace all occurrences of the codename bullseye with bookworm.
Current source.list should look similar to this:
deb http://deb.debian.org/debian/ bullseye main deb-src http://deb.debian.org/debian/ bullseye main deb http://security.debian.org/debian-security bullseye-security main deb-src http://security.debian.org/debian-security bullseye-security main deb http://deb.debian.org/debian/ bullseye-updates main deb-src http://deb.debian.org/debian/ bullseye-updates main
Modified source.list will look like this once you're done:
deb http://deb.debian.org/debian/ bookworm main deb-src http://deb.debian.org/debian/ bookworm main deb http://security.debian.org/debian-security bookworm-security main deb-src http://security.debian.org/debian-security bookworm-security main deb http://deb.debian.org/debian/ bookworm-updates main deb-src http://deb.debian.org/debian/ bookworm-updates main
For Debian 12 onwards, all the packaged non-free firmware binaries that Debian can distribute have been moved to a new component in the Debian archive called non-free-firmware. If you had only enabled the non-free component on your system to allow firmware installation, you can safely remove it now. However, if you require these firmware binaries, you can add the following line after the main lines.
deb https://deb.debian.org/debian/ bookworm main contrib non-free non-free-firmware
Debian is distributed (mirrored) on hundreds of servers worldwide. In the example above, we have used a repository located in the United States. To speed up downloads, you can choose a Debian mirror based on your geographic location.
Third-party software installed from Personal Package Archives (PPAs) will be disabled during the upgrade process. This may not apply to your system. Prior to starting the upgrade, identify any PPAs by looking for .list files in the /etc/apt/sources.list.d/ directory. If present, you will need to update them once the system upgrade is complete. Check with the software distributor for instructions, as software channels outside the standard Debian repositories may not support this new release.
Update the package index.
Upgrade the minimal base system.
Upgrade all other packages and dependencies.
Reboot the system.
Verify your release has been upgraded.
Output will be similar to this.
No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 12 (bookworm) Release: 12 Codename: bookworm
Clear out the local repository of retrieved package files and dependencies that are no longer required.