Upgrading Debian 11 (Bullseye) to Debian 12 (BookWorm)

If you think you are ready to upgrade your Debian 11 Bullseye server to Debian 12 Bookworm Linux, then here is the step-by-step guide to follow with a detailed explanation of each step.

Do I need to introduce Debian? Ofcourse not because it is one of the widely used and extremely stable Linux distros for servers and also preferred by Desktop users who want a well-tested Linux OS. With every new release, Debian offers new features, improvements, and updated software packages. While doing this article although Debian 11 was supported still those who prefer new software packages can shift to Debian 12 codename “bookworm”.

Unlike other Linux server operating systems upgrading the Debian system is quite easy and offers a seamless transition to the latest version without losing your data or configurations. So, whether you are a novice Linux user or an experienced one, this guide will help you in the process of upgrading your Debian 11 system to Debian 12.

However, those who are still on Debian 10 can first upgrade to Debian 11 and then to 12.

Commands to Upgrade Debian 11 to 12

Step 1: Review Release Notes:

Well, first you should check out the release notes for Debian 12 released by the Developers to know what are the changes and new features included in the upgrade. It helps you to understand the OS if you are planning to run some particular software on it.

Step 2: Update and Upgrade Debian 11

Now, before taking any step to shift from your current Linux version let’s make sure all the packages on your Debian 11 are up to date and the system is ready to switch to an upgraded version. Go to your Debian 11 and run the following commands:

sudo apt update && sudo apt upgrade

Run the distribution upgrade command, if there is anything that needs to be updated further, the command will do that.

sudo apt dist-upgrade
Debian 11 upgrade command

Step 3: Back Up Your Data:

This is quite an important step if you have some important data, which is quite possible you would have, then back up it first on some pen drive or cloud. For example, documents, configurations, or any critical file. Although the process of upgrading Debian is quite straightforward, still, for safety it is recommended to take the backup before moving further.

Step 4: Update Package Sources:

We need to edit your /etc/apt/sources.list file to point it to the new Debian 12 (Bookworm) repositories. Replace all instances of “bullseye” with “bookworm” in this file:

However, to make things easy instead of editing the old source file, let’s rename it and create a new file.

sudo mv /etc/apt/sources.list /etc/apt/sources.list.bk

Now create a new one:

sudo nano /etc/apt/sources.list

Copy-paste the following lines:

deb https://ftp.debian.org/debian/ bookworm contrib main non-free non-free-firmware

deb https://ftp.debian.org/debian/ bookworm-updates contrib main non-free non-free-firmware

deb https://ftp.debian.org/debian/ bookworm-proposed-updates contrib main non-free non-free-firmware

deb https://ftp.debian.org/debian/ bookworm-backports contrib main non-free non-free-firmware

deb https://security.debian.org/debian-security/ bookworm-security contrib main non-free non-free-firmware
Debian 12 defautl system repositories URL

Step 5: Perform Debian 11 to 12 Upgrade:

We have added the Debian 12 repository to our existing Debian 11 Linux, now as we run the system update and upgrade command, it will fetch the latest packages and features available to install.

sudo apt update && sudo apt upgrade

Step 6: Handle Configuration File Changes:

When the system gives you information about the packages that are going to upgrade, you can read that or exit and let the process continue by pressing – q and hitting the Enter key.

Read package update information

While performing the upgrading process the system may ask you to review and update configuration files, and package versions or to restart the services automatically. Carefully, asses them and give your consent to keep your current configuration or use the new one provided by the package maintainer.

upgrade to Debian 12
Restart system services automatically

Once the all processes are completed initiated by your previous command, also run to give final touch:

sudo apt dist-upgrade

Step 7: Reboot the System:

If you have performed all the previous steps successfully, your system will be completely upgraded to Debian 12 Bookworm. Now, to complete the process and load the new version of the kernel and associated software properly, just reboot your system once.

sudo reboot

Step 8: Verification and Post-Upgrade Testing:

Verify that your system is running Debian 11 (Bullseye) by using the command given in this step or by checking your system information. After that thoroughly test your system to ensure that all your essential software and services are working as expected.

cat /etc/os-release
verify debian 12 upgrade

Step 9: Cleanup and Maintenance:

Remove obsolete packages and perform system maintenance tasks to free up disk space:

sudo apt autoremove
sudo apt clean

Conclusion:

We have learned the essential steps to ensure a smooth and successful upgrade while preserving our data and settings. As compared to RHEL-based Linux upgrading Debian Linux is quite and less problematic. However, it is still recommended that you back up your data and configuration settings to dodge any unexpected issues. Also, always check the official Debian documentation for the latest instructions and updates to ensure a successful upgrade.

Leave a Comment

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