How to upgrade Debian 10 (buster) to Debian 11 (bullseye) Print

  • 1

This article will explain how to upgrade an existing Debian 10 server to Debian 11.

Step 1: Update current server packages

  1. You need root privileges
apt-get update
apt-get upgrade

apt-get autoremove

Step 2: Change the Debian Sources

Aptitude (Apt) downloads packages from one or more repositories for installation on your server. It finds the correct repositories, available packages, and versions to download in /etc/apt/sources.list. So, you need to replace all Debian 10 codenames with Debian 11 codenames in /etc/apt/sources.list.

  1. Confirm the Debian 10 codename by running the following command. Debian 10 is codenamed buster.

    cat /etc/debian_version
    10.13
  2. Back up the original configuration files to your home directory.

    sudo cp /etc/apt/sources.list ~/sources.bakapt autoremove
    sudo cp -r /etc/apt/sources.list.d/ ~/sources.list.d.bak
  3. Replace all buster entries with bullseye

    sed -i 's/buster/bullseye/g' /etc/apt/sources.list
  4. Update the package list. If you made the changes correctly, there won't be any errors displayed during the update process.

    apt-get update
  5. Perform a system upgrade. Use the --without-new-pkgs flag to avoid removing the packages you intend to keep on your server.

    apt-get upgrade --without-new-pkgs

    You will be prompted to restart specific services or to keep and erase specific config options. Answer yes.

Step 3: Upgrade Debian

Now you can safely run a full upgrade to Debian 11 with the following command:

apt full-upgrade

This will run a full upgrade of the server from Debian 10 to Debian 11, resolve possible dependencies changes, install the newest versions of all packages, and remove any obsolete packages. During the system upgrade process, additional prompts may be displayed to restart services and update existing configuration options. Be sure to select appropriate choices to avoid unwanted changes to existing applications.

When a pager indicator : is displayed, type Q to continue.

Type Y when prompted to modify /etc/sysctl.conf.

Configuration file '/etc/sysctl.conf'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ? Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.

Step 4: Reboot the Server

  1. After the system upgrade is complete, restart your server for changes to take effect.

    reboot now

    Your current SSH connection will be dropped.

  2. Wait for a minute for the server to reboot.

  3. Log in through SSH.

  4. Check the current operating system version and verify it shows Debian 11, bullseye.

    cat /etc/debian_version
    11.8

     


Was this answer helpful?

« Back