
Performing a successful upgrade from Debian 11 (code-named Bullseye) to the latest version, Debian 12 (Bookworm), requires careful preparation and execution. This guide outlines the essential steps to ensure a smooth transition.
Before beginning the upgrade process, it is paramount to take a full backup of your system data and configuration files. This provides a safety net in case any issues arise during the upgrade. Additionally, ensure your current Debian 11 system is fully up-to-date. This involves running apt update followed by apt upgrade and potentially apt full-upgrade to apply all pending security and package updates for Bullseye. Check for any packages held back or configuration issues before proceeding.
The core of the upgrade involves modifying the system’s software sources. You will need to edit the /etc/apt/sources.list
file and potentially files within /etc/apt/sources.list.d/
. Replace all instances of the code-name bullseye with bookworm. It’s also advisable to update any references to the Debian security repository from bullseye/updates
to bookworm-security
.
Once the sources are updated to point to Debian 12 repositories, the actual upgrade can begin. Start by running apt update again to fetch the new package lists for Bookworm. This should show packages from the Debian 12 repositories. The first phase of the upgrade is typically performed using apt upgrade. This command will install new package versions but avoids removing any packages that are currently installed.
After the initial upgrade completes, the more comprehensive phase is executed using apt full-upgrade. This command is crucial as it handles package additions, removals, and changes required to fully transition to Debian 12. Pay close attention during this step, especially to prompts regarding configuration files. You will often be asked if you want to keep your existing configuration files or install the package maintainer’s version. Carefully consider each prompt based on your system’s customizations.
Following the successful completion of apt full-upgrade, it’s important to clean up obsolete packages using commands like apt autoremove. Review any messages or errors encountered during the upgrade process. Finally, reboot your system to load the new Debian 12 kernel and services. Verify that your system is running Debian 12 and that all essential services and applications are functioning correctly. This methodical approach helps ensure a stable and successful migration to Debian 12 Bookworm.
Source: https://kifarunix.com/quick-way-to-upgrade-debian-11-to-debian-12/