How to upgrade Debian 11 Bullseye to Debian 12 Bookworm

Why do you need to upgrade to Debian 12 Bookworm ?

If you are happy with Bullseye no need to upgrade. Unless there is a specific need do not upgrade. But in case you are like me and love keeping upto date with latest versions then go ahead. One of the major change in this version is use Wayland rather than X11 as the main display system. This is one of the reason I am upgrading my raspberry pi. There are losts of other small small updates like support for secondary browser Firefox, PipeWire etc.

The steps to follow is as follows:

Backup the system.

You can use any software to backup your system. This is very important step, as it will help to rollback incase the upgrade fails and your system is in inconsistent state.

Update existing packages and reboot the Debian 11 system.

$ sudo apt update

$ sudo apt upgrade

$ sudo apt full-upgrade

$ sudo apt –purge autoremove

Once the upgrade is done, reboot the system.

$ sudo systemctl reboot

Update /etc/apt/sources.list file

Edit the file /etc/apt/sources.list using a text editor and replace each instance of bullseye with

To begin the upgrade process, it is necessary to reconfigure the source-list files of APT. You can view the current settings by using the commands cat command or more command. This will display the list of Debian 11 repo URLs.
$ sudo cat /etc/apt/sources.list
Outputs:

If you intend to use Debian 12 on either a desktop or server that requires non-free firmware for hardware such as WiFi, GPU, Sound, Nvida/AMD GPU, NIC and more, it is recommended to include the non-free firmware repository. Below is the updated file /etc/apt/sources.list file. The orange color repo config indicates that non-free firmware is required for your hardware. If you’re unsure about your hardware, I suggest adding those repositories.

Updating the package list

Finally, run the following command to get fresh apt repo data:

$ sudo apt update


A two-part process is important to avoid removing large numbers of packages you want to keep. Therefore, first, run the following command to apply:

$ sudo apt upgrade –without-new-pkgs

Please carefully follow the on-screen instructions.

Upgrading Debian 11 to Debian 12

To fully update from Debian 11 to Debian 12, it’s necessary to make complete upgrades, rather than just minimum ones. This step is crucial for the upgrade process. To do this, enter the following command to ensure that the latest versions of all packages are installed and any potential dependencies are resolved. For example:

$ sudo apt full-upgrade

After you are done with the updating process, you need to restart the raspberry pi or any other system that you are updating.

Make sure there are no errors in the SSHD config file for the remote server:
$ sudo sshd -t
If there are no errors, you can proceed with rebooting the system. However, if there are any errors, it is important to fix them before rebooting. To do so, run:
$ sudo vim /etc/ssh/sshd_config
Verify again:
$ sudo sshd -t
Now reboot it after fixing any errors:
$ sudo systemctl reboot

Do let me know how it goes for you.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.