Are you planning to upgrade to the latest release of Debian 12 (codenamed “Bookworm”), from Debian 11? But did you know that instead of downloading the Debian 12 ISO file and installing it, you can simply upgrade your existing Debian 11 to Debian 12 by following a few steps? Yes, you heard right.
In this blog, we will discuss the simple procedure of upgrading Debian 11 to Debian 12.
Why Should Upgrade to Debian 12 (Bookworm) from Debian 11?
The stable version of Debian 12 was released recently on 10th June 2023, after the development of almost one year and ten months. The Debian 12 codename is “Bookworm” and it will be supported for the coming five years.
People are planning to move to Debian 12 due to various reasons, let’s list a few of them:
- It has introduced over 11,089 new packages, and 43,254 existing packages have been updated.
- It includes a large number of translated man pages in multiple languages, such as German, Greek, Finnish, Indonesian, Czech, Norwegian, Swedish, Vietnamese, Serbian, Russian, and more.
- It has an improved installer and supports multiple desktop environments like GNOME, Plasma, LXDE, KDE, LXQt, Xfce, and MATE.
- It supports nine architectures: 64-bit ARM, ARMv7, IBM System Z, 32-bit PC (i386) and 64-bit PC, ARM EAB, and more. However, it does not support any i586 processor of a 32-bit PC. If you have one you should keep enjoying Debian 11.
- It has introduced a brand-new repository called “non-free-firmware” that separates non-free firmware from the remaining non-free packages. This aids in enabling the proper functioning of hardware components, such as network adapters or graphics cards.
- It contains many updated software packages including Apache 2.4.57, GnuPG 2.2.40, Nginx 1.22, PostgreSQL 15, OpenJDK 17, Vim 9.0, and the list goes on.
To know more about the benefits of Debian 12, hop to the Debian release webpage.
Now power on your Debian 11 and start following the procedure to smoothly upgrade Debian 11 to Debian 12 in just a few minutes.
Upgrading to Debian 12 from Debian 11
To upgrade to Debian 12 (bookworm) from Debian 11 (Bullseye), follow the steps listed below:
Step 1: Check Debian Version
To check the Debian distribution name and version number, execute the following command in the terminal of Debian 11.
$ lsb_release -d Description: Debian GNU/Linux 11 (bullseye)
Let’s now display the version number of our Debian 11 using the cat command.
$ cat /etc/debian_version 11.7
Step 2: Update Debian 11 Packages
The next step is to upgrade the installed packages by running apt commands:
$ sudo apt update $ sudo apt upgrade
Both these commands will consume some time, wait for the completion.
Once the package list is up-to-date, it’s a better approach to remove unnecessary packages from your system by executing.
$ sudo apt --purge autoremove
Step 3: Update /etc/apt/sources.list File
It’s time to modify the package sources to point to the Debian 12 repositories. For that purpose open the “sources.list” using any text editor, here we will be using the nano editor:
$ sudo nano /etc/apt/sources.list
After the execution of the above command, the “source.list” file will open in the terminal using the nano editor. Observe the places where the package sources indicate to Debian 11 (bullseye):
Now replace all instances of “bullseye” with “bookworm” as shown below:
deb https://ftp.debian.org/debian/ bookworm contrib main non-free non-free-firmware # deb-src 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-src 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-src 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-src 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 # deb-src https://security.debian.org/debian-security/ bookworm-security contrib main non-free non-free-firmware
Step 4: Upgrade to Debian 12
As the package sources are modified, let’s update the repositories by typing:
$ sudo apt update
After the “update” command, execute the following command to upgrade the existing packages:
$ sudo apt upgrade --without-new-pkgs
To finish the upgrade process, follow the on-screen instructions carefully, as the process may ask you a few questions such as “Would you like to restart the service?” or “Keep or erase configuration file options?” throughout the process.
Finally, execute the command listed below to do a full system upgrade to Debian 12.
$ sudo apt full-upgrade
When the ':'
icon will appear, press enter until a configuration window appears. In the package configuration window, select “OK”.
Select the desired locale for the system and click on the “OK” button.
Select the font for your Debian 12 and press “OK”.
The package configuration will also ask to install the “ca-certificate” package.
Some prompts will appear to restart some of the services like libc and libssl. Select “Yes” for these prompts to continue:
After the completion of the full upgrade, reboot the system to enjoy your upgraded Debian 12.
$ sudo systemctl reboot
The login screen will display Debian 12 having the same users and credentials as Debian 11.
Open the terminal in your new Debian 12 and run the provided commands, which will display the system information:
$ lsb_release -a $ cat /etc/debian_version
Step 5: Remove Unwanted Packages from Debian
As we upgraded from Debian 11 to Debian 12, there must be many obsolete or unwanted packages. To remove all those packages, type this command:
$ sudo apt --purge autoremove
All the unnecessary packages are removed from Debian 12.
Conclusion
The newly released Debian 12 offers numerous benefits, including updated software packages, enhanced security, improved hardware support, and new features.
The user can easily upgrade to Debian 12 from the existing Debian 11 by modifying the package sources to point to the Debian 12 repositories (bookworm) and then fully upgrading the system.
Thanks, very helpful! I just upgraded to Debian 12 in a VM running on UTM on my M1 Macbook and all went perfectly.
@Mike,
You’re welcome! I’m glad to hear that the upgrade to Debian 12 on your M1 Macbook via UTM went smoothly. If you have any more questions or need further assistance in the future, feel free to reach out.
I had a nonfirmware version that required to update/upgrade from DVD CDROM which was a pain. I followed your instructions and I was able to upgrade seamlessly.
Great job and Shout out.
I don’t think you need to include backports in repositories like they did in this example for some reason. That was a bit inconsistent as they did not have them in 11. Weird that…
@Tony,
The reason for including backports is because Debian is a rolling release distribution, which means that it is constantly being updated with new packages. This means that backports are often necessary to provide newer features or bug fixes to older Debian distributions.
If my repositories were pointing to testing do I need to do anything?