How to Upgrade from Debian 11 Bullseye to Debian 12 Bookworm


Debian is a widespread Linux distribution known for its stability and security. The upcoming version of Debian 11 Bookworm is an exciting release that looks to feature Linux Kernel 6.1 and GNOME 43. The Debian Release Team has proposed the following schedule for the release of Debian 12.0: transition and toolchain freeze around January 12, 2023, soft freeze around February 12, 2023, and complete hard freeze around March 12, 2023. The release of Debian 12.0 is expected to take place a few months after that, depending on the progress of bug fixes. A mid-2023 release is expected.

People eager to upgrade to Debian 12 Bookworm can do so from Debian 11 Bullseye, but it’s important to note that some bugs may be present. However, for those who are comfortable with testing software or are not bothered by potential issues, upgrading from Debian 11 Bullseye to Debian 12 Bookworm is possible with a few simple steps.

Step 1: Update Debian System Packages

Run the following command in the terminal to update your current 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 “sources.list” to Bookworm

It is now essential to update the sources list from Bullseye to Bookworm. This can be done efficiently with a single command instead of manually editing the “/etc/apt/sources.list” file. Use the following command in the terminal to do this.

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

Step 3: Run the Upgrade to Debian 12 Bookworm

Initially, you need to 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.

Whether or not to restart services is up to the user. It is important to note that you should not run any important services during the upgrade process. For server users, it is crucial to stop any 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.

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.

Example:

Please note that the login screen may still display the Debian 11 logo. However, this will be updated soon.

Step 4: Upgrade Post-Installation Check

Verifying the Debian operating version and building using the CAT command is recommended after the upgrade process is finished.

cat /etc/os-release

Example output confirming the upgrade:

Step 5: Clean Up Obsolete Packages (Optional)

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

sudo apt --purge autoremove

Troubleshooting

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 a smooth process, but it is important to take the necessary precautions before proceeding. It is recommended to back up your data and ensure that all the required packages are up to date. 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.

See also
How to Install MariaDB 10.x on Debian 11 or 10

Leave a Comment

Share to...