Home Debian How to Upgrade From Debian 11 to Debian 12

How to Upgrade From Debian 11 to Debian 12

This blog will unfold the journey of upgrading your already installed Debian 11 to Debian 12 (codenamed “Bookworm”). Whether you’re an experienced, seasoned Debian user or a newcomer, I assure you that this guide will be beneficial for you.

Why Do You Need Debian 12?

The wait is over, as Debian 12 has finally released its stable version on June 10, 2023, which comes with an impressive five years of support, exciting features, and security improvements.

Let’s explore some of the notable features offered by this release:

  • Support for numerous desktop environments including Gnome 43, Xfce 4.18, KDE Plasma 5.27, LXQt 1.2.0, and more.
  • Offers an updated GNOME desktop environment with a modern user interface.
  • Introduced a new repository named “non-free-firmware” to separate the non-free firmware from the non-free packages.
  • Supports 9 architectures: 64-bit ARM, 32-bit PC, 64-bit PC, ARMv7, and more.
  • Addition of almost 11,089 new packages that were not available in Debian 11.
  • Availability of man pages translated into multiple languages.

These are a few of the numerous impressive features offered by Debian 12. However, if you know more about Debian 12, jump to release page.

Without any delay, let’s power on our Debian 11 and start the journey of upgrading it to Debian 12 smoothly.

Note: Make sure to back up your Debian 11 so that you do not lose any important data or files. To do so, you can utilize any backup utility.

Updating Debian 11 Packages

To upgrade Debian 11 to Debian 12 (Bookworm), implement the provided steps for a seamless transition.

Open the terminal in your Debian 11 and execute the command stated below to check the description of Debian distribution:

$ lsb_release -d

Furthermore, you can also view the version number of installed Debian by utilizing the cat command.

$ cat /etc/debian_version
Check Installed Debian Version
Check Installed Debian Version

Before upgrading your Debian system, run the command given below to ensure that your system is up-to-date:

$ sudo apt update && sudo apt upgrade -y

The next step is to remove all the unnecessary packages from your system by running the “apt --purge autoremove” command:

$ sudo apt --purge autoremove 

Moving forward, it’s time to make changes in the package sources file named “sources.list” in order to direct it towards the Debian 12 repositories.

Adding Debian 12 Repositories

To modify this file, let’s open it by utilizing the nano editor:

$ sudo nano /etc/apt/sources.list

You can see that all the repositories are indicating “Bullseye” which is the codename of Debian 11.

Debian Sources File
Debian Sources File

Now replace the content of the file with the lines provided below:

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

After making changes in the file, save it and press the “CTRL + O” keys to exit the file:

Debian 12 Sources File
Debian 12 Sources File

The package sources are finally indicating to Debian 12 repositories successfully.

Upgrade From Debian 11 to Debian 12

Next, execute the apt update command to refresh the local repositories cache:

$ sudo apt update

After the execution of the update command, run the command to upgrade the existing packages:

$ sudo apt upgrade --without-new-pkgs -y
Upgrade Debian Packages
Upgrade Debian Packages

During the upgrade process, you will encounter a few prompts, read and address them carefully.

Configure libc6
Configure libc6

When prompted to restart the services during the upgrade, select the “Yes” option.

Restart Services During Reboot
Restart Services During Reboot

Finally, run the following command to upgrade the system to Debian 12:

$ sudo apt full-upgrade -y
Upgrading from Debian 11 to Debian 12
Upgrading from Debian 11 to Debian 12

After the completion of the full system upgrade, reboot the system to access your Debian 12:

$ sudo systemctl reboot

Once the system is rebooted, open the terminal and run the “lsb_release -d” command to see the description of your Debian Linux 12:

$ lsb_release -d

Also to verify its version number, feel free to run the command stated below:

$ cat /etc/debian_version
Check Debian 12 Version
Check Debian 12 Version

Let’s just remove the unwanted packages from your Debian 12 for an optimized experience by running the command listed below:

$ sudo apt --purge autoremove

Enjoy the latest version of Debian!

Conclusion

Debian has recently released its stable version, offering enhanced security and exciting features. You have the option to install Debian 12 using its ISO file or upgrade from Debian 11 directly.

This blog has offered a tutorial for upgrading your Debian 11 to Debian 12.

Ravi Saive
I am an Experienced GNU/Linux expert and a full-stack software developer with over a decade in the field of Linux and Open Source technologies. Founder of TecMint.com, LinuxShellTips.com, and Fossmint.com. Over 150+ million people visited my websites.

Each tutorial at UbuntuMint is created by a team of experienced writers so that it meets our high-quality standards.

Was this article helpful? Please add a comment to show your appreciation and support.

2 thoughts on “How to Upgrade From Debian 11 to Debian 12”

  1. Hi Ravi,

    I’ve written 2 scripts to automate the upgrade to bookworm.

    If it can help:

    # wget https://github.com/charlesvissol/debiandesktop-hardening/blob/main/91_Bullseye_to_Bookworm.sh
    # sh 91_Bullseye_to_Bookworm.sh
    

    Reboot

    # wget https://github.com/charlesvissol/debiandesktop-hardening/blob/main/92_Bullseye_to_Bookworm.sh
    # sh 92_Bullseye_to_Bookworm.sh
    
    Reply
    • @Vissol,

      That’s great!

      Thank you for sharing your scripts.

      Automating the upgrade process can indeed be a time-saving and efficient approach. By automating the upgrade to Debian 12 (Bookworm), readers can benefit from a streamlined process that reduces manual effort and potential errors.

      Reply

Got something to say? Join the discussion.

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published or shared. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.