How to Upgrade from Debian 11 Bullseye to Debian 12 Bookworm

For Debian enthusiasts and users, the release of Debian 12 “Bookworm” marks a significant milestone, offering many enhancements and features. If you’re currently on Debian 11 “Bullseye” and contemplating an upgrade, this guide will provide a detailed roadmap on how to Upgrade from Debian 11 Bullseye to Debian 12 Bookworm, ensuring a smooth transition.

Key Highlights of Debian 12 “Bookworm”:

  • Desktop Environments: Debian 12 boasts updated desktop environments, including Gnome 43, KDE Plasma 5.27, LXDE 11, LXQt 1.2.0, MATE 1.26, and Xfce 4.18.
  • Package Evolution: With over 11,089 new packages, the total count now stands at 64,419. Over 6,296 obsolete packages have been removed, and more than 43,254 packages have been updated. Notable software upgrades include Apache 2.4.57, Linux kernel 6.1 series, LibreOffice 7.4, OpenJDK 17, and Python 3.11.2.
  • Multilingual Support: Adding translated man-pages in languages like Czech, Danish, and Greek ensures a broader reach and user-friendly experience.
  • Specialized Blends: New packages have been introduced in the Debian Med Blend and Debian Astro Blend, catering to specific user needs.
  • ARM64 Secure Boot: Debian 12 reintroduces support for Secure Boot on ARM64, enhancing security for UEFI-capable ARM64 hardware.
  • Architecture Enhancements: Official support has been extended to nine architectures, with notable changes in the minimum processor requirements for 32-bit PCs (i386).
  • Cloud Integration: Debian 12 is now available on various cloud platforms, including Amazon EC2, Microsoft Azure, and OpenStack.
  • GRUB and Filesystem Updates: Changes in GRUB packages and filesystem layout have been implemented to improve system performance and compatibility.

The introduction of Debian 12 “Bookworm” underscores the Debian Project’s dedication to providing a stable, innovative, and user-centric operating system. As we delve deeper into this guide, you’ll be equipped with the necessary steps and insights to transition seamlessly from Debian 11 “Bullseye” to Debian 12 “Bookworm”.

Step 1: Update Debian System Packages

Run the following terminal command to update your Debian 11 Bullseye installation:

sudo apt update && sudo apt upgrade

Rebooting your system is crucial if you have updated many packages, including the kernel.

reboot

Step 2: Change Bullseye in “sources.list” to Bookworm

To ensure a smooth transition, updating the sources list from Bullseye to Bookworm is crucial. Instead of manually editing the /etc/apt/sources.list file, you can efficiently perform this task using the following command in the terminal:

sudo sed -i 's/bullseye/bookworm/g' /etc/apt/sources.list

For users who require access to non-free and contrib repositories, which may or may not be already enabled, verify their presence by running the following command after updating the sources list:

grep "deb http://deb.debian.org/debian/ bookworm main contrib non-free-firmware" /etc/apt/sources.list

If the previous command returns no output (indicating the line doesn’t exist), use the following sed commands to modify the existing “bookworm main” line by appending “contrib” and “non-free”:

sudo sed -i '/deb http:\/\/deb.debian.org\/debian\/ bookworm main/ s/$/ contrib non-free-firmware/' /etc/apt/sources.list
sudo sed -i '/deb-src http:\/\/deb.debian.org\/debian\/ bookworm main/ s/$/ contrib non-free-firmware/' /etc/apt/sources.list

These commands will ensure that your Debian system can access the non-free and contrib repositories and the central repository.

This is an example of /etc/apt/sources.list open with nano text editor, which, after executing the above commands, should look like this or close to it:

Screenshot showcasing Debian 12 Bookworm repositories replacing Debian 11 Bullseye's.
See how those of Debian 12 Bookworm replace Debian 11 Bullseye repositories.

Step 3: Run the Upgrade to Debian 12 Bookworm

Initially, you must synchronize the cache with the Debian 12 Bookworm repositories by running a simple APT update command.

sudo apt update

To upgrade to Debian 12 Bookworm, run the following command in the terminal:

sudo apt full-upgrade

Please note that you may be asked to restart services during the upgrade process, as shown in the example below:

Notification screenshot about restarting services during Debian 12 Bookworm upgrade.
A critical notice about the need to restart services as part of the Debian 12 Bookworm upgrade process.

Whether or not to restart services is up to the user. It is important to note that you should not run any essential services during the upgrade process. For server users, it is crucial to stop services such as Nginx, MySQL, and PHP and make backups of configuration files. This is an excellent practice to have in place, regardless of an upgrade.

Step 4: Reboot to Finalize Debian 12 Distribution Upgrade

Once the upgrade process is complete, reboot your system by running the command in the terminal.

reboot

You will notice a new background and the Linux Kernel 6.1 starting during the reboot.

Loading screen screenshot of Debian 12 Bookworm system boot.
Experience the visual aesthetics of the Debian 12 Bookworm boot-up process.

Step 5: Upgrade Post-Installation Check on Debian 12

After upgrading, verifying the Debian operating version and building using the CAT command is recommended.

cat /etc/os-release

Example output confirming the upgrade:

Screenshot of using the 'cat' command to confirm the Debian 12 Bookworm upgrade.
Verifying the successful upgrade to Debian 12 Bookworm using the ‘cat’ command in the terminal.
Neofetch command output screenshot for Debian 12 Bookworm.
Discover system details of Debian 12 Bookworm with the Neofetch command output.

Step 5: Clean Up Obsolete Packages (Optional)

Removing old and unnecessary packages from your Debian 12 system for optimal performance and cleanliness is recommended using the –purge and autoremove commands:

sudo apt --purge autoremove

Troubleshooting Debian 11 to 12 Distribution Upgrade

Nvidia Drivers

It is currently suggested to remove Nvidia drivers, as some users have reported issues during upgrades. To do this, use a command to eliminate any remaining Nvidia components on your system.

sudo apt autoremove nvidia* --purge

Another way to uninstall Nvidia drivers is for those installed using the “.run” file. It is advised to remove this installation and use the command provided.

sudo /usr/bin/nvidia-uninstall

As a last resort, if the above options do not work, try uninstalling the CUDA toolkit using the command provided.

sudo /usr/local/cuda-X.Y/bin/cuda-uninstall

It is important to note that you may need to list the directories to locate the CUDA repository correctly.

ls /usr/local/cuda*

Conclusion

In conclusion, upgrading from Debian 11 Bullseye to Debian 12 Bookworm can be smooth, but taking the necessary precautions before proceeding is essential. It is recommended to back up your data and ensure all the required packages are current. Removing old and unnecessary packages is also suggested to keep your system clean and efficient. Additionally, if you encounter any issues with Nvidia drivers, it is recommended to remove them before upgrading. Following these steps should ensure a successful upgrade to Debian 12 Bookworm.

Leave a Comment


Your Mastodon Instance
Share to...