Skip to main content

Upgrade Debian 10 (Buster) to Debian 11 (Bullseye)

Upgrading your operating system can seem daunting, but moving from Debian 10 (Buster) to Debian 11 (Bullseye) is a straightforward process if you follow these steps. Before proceeding, ensure you have a backup of your data, a stable internet connection, and root or sudo privileges for your user account.


Prerequisites

  1. Superuser Privileges: You must perform the upgrade with superuser privileges. Log in as root or a user with sudo privileges.
  2. Data Backup: Back up your data before starting the upgrade. If you're using a virtual machine, consider taking a complete system snapshot.

Update Current Packages

  1. Check for Held Back Packages: Run sudo apt-mark showhold to check for any packages that are held back, as they can cause issues during the upgrade. Unhold them if necessary.
  2. Update Installed Packages: Refresh your package index and upgrade all installed packages using the following commands:
    sudo apt update
    sudo apt upgrade
  3. Perform a Full Upgrade: Use sudo apt full-upgrade to update your packages to the latest versions. This command may also remove unnecessary packages.
  4. Clean Up: After the full upgrade, remove any automatically installed dependencies that are no longer needed with sudo apt autoremove.

Modify APT’s Source-List Files

  1. Reconfigure APT Sources: Open /etc/apt/sources.list and replace each occurrence of buster with bullseye. If you have other source files under /etc/apt/sources.list.d, update those as well.
  2. Using sed Command: Alternatively, execute the following sed commands to update your sources list:
    sudo sed -i 's/buster/bullseye/g' /etc/apt/sources.list
    sudo sed -i 's/buster/bullseye/g' /etc/apt/sources.list.d/*.list
    sudo sed -i 's#/debian-security bullseye/updates# bullseye-security#g' /etc/apt/sources.list
    deb http://deb.debian.org/debian bullseye main contrib non-free
    deb http://deb.debian.org/debian bullseye-updates main contrib non-free
    deb http://deb.debian.org/debian-security bullseye-security/updates main
  3. Set Terminal Output to English: This helps to avoid language-specific issues during the upgrade. Use export LC_ALL=C to set the language to English.
  4. Update Packages Index Again: Run sudo apt update to refresh the package index with the new sources.

Perform the System Upgrade

  1. Upgrade Installed Packages: Begin the system upgrade with sudo apt upgrade. This step upgrades packages without requiring additional packages to be installed or removed.
  2. Full System Upgrade: Execute sudo apt full-upgrade to perform a complete system upgrade. This command resolves dependency changes and upgrades packages that were not updated in the previous step.
  3. Clean Up and Reboot: After completing the full upgrade, clean up unnecessary packages again with sudo apt autoremove. Then, reboot your machine to activate the new kernel using sudo systemctl reboot.

Confirm the Upgrade

After rebooting, confirm that your system has been successfully upgraded to Debian 11 (Bullseye) by running lsb_release -a. The output should indicate Debian GNU/Linux 11 (Bullseye) as the distribution.