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.
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
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.
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:
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
During the upgrade process, you will encounter a few prompts, read and address them carefully.
When prompted to restart the services during the upgrade, select the “Yes” option.
Finally, run the following command to upgrade the system to Debian 12:
$ sudo apt full-upgrade -y
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
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.
Hi Ravi,
I’ve written 2 scripts to automate the upgrade to bookworm.
If it can help:
Reboot
@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.