Upgrading Debian Bullseye (11) to Bookworm (12) on server and desktop

If you are a Debian user who wants to enjoy the latest features and improvements of the upcoming Debian 12 “Bookworm” release, you might be wondering how to upgrade your system from the current stable version, Debian 11 “Bullseye”.

In this post, I will guide you through the steps of upgrading your Debian desktop or server from Bullseye to Bookworm, using the official Debian repositories.

Before we start, make sure we have a backup of our important data and configuration files, as well as a reliable internet connection. Also, we have to inform our users in advance if we are upgrading a server that provides services to others.

The upgrade process may take some time, depending on our hardware and network speed, so we must be patient and do not interrupt it.

Step 1: Update our Bullseye system

The first step is to update our current Bullseye system to the latest available packages. This will ensure that we have the most recent bug fixes and security updates.

To do this, open a terminal and run the following command:

$ apt update && apt full-upgrade -y

This will fetch the package lists from the repositories and upgrade any packages that have newer versions available. We may be asked to confirm some actions or configuration changes during this process. Follow the instructions on the screen and choose the options that suit our preferences.

Step 2: Change our sources.list file to Bookworm

The next step is to change our sources.list file, which tells APT where to look for packages, to point to the Bookworm repositories instead of the Bullseye ones.

We can do this by editing the file with our favorite text editor, such as nano or vim:

$ nano /etc/apt/sources.list

In this file, we will see some lines that start with deb or deb-src , followed by a URL and a codename ( bullseye ). We have to replace all occurrences of bullseye with bookworm , so that our sources.list file looks something like this:

deb http://deb.debian.org/debian bookworm main
deb-src http://deb.debian.org/debian bookworm main
deb http://security.debian.org/debian-security bookworm-security main
deb-src http://security.debian.org/debian-security bookworm-security main
deb http://deb.debian.org/debian bookworm-updates main
deb-src http://deb.debian.org/debian bookworm-updates main

Save and close the file when we are done.

If we have any additional sources in our sources.list file or in other files under /etc/apt/sources.list.d/ , we need to change them as well.

Step 3: Run the upgrade to Debian 12 Bookworm

Now that we have changed our sources.list file, we can run the upgrade to Debian 12 Bookworm.

To do this, run the following commands in a terminal:

$ apt update && apt full-upgrade -y

The first command will update the package lists from the Bookworm repositories, and the second command will perform the actual upgrade.

This may take a while, as APT will download and install many new packages. We may also be asked to confirm some actions or configuration changes during this process.

We have to follow the instructions on the screen and choose the options that suit our preferences.

In some cases we may want to run the update in two stages: at first do do not download new packages:

$ apt upgrade --without-new-pkgs
$ apt full-upgrade -y

The above example is very useful on servers with a lot of services.

Step 4: Upgrade post-installation check

After the upgrade is finished, we should reboot our system to load the new kernel and other components.

To do this, run:

$ reboot

Once our system is back online, we can check if everything is working as expected.

We can verify that we are running Debian 12 Bookworm by running:

$ lsb_release -a

We can also check if there are any obsolete packages that can be removed by running:

$ apt autoremove -y

This will remove any packages that are no longer needed by other packages on our system.

Congratulations! We have successfully upgraded our Debian system from Bullseye to Bookworm.

Enjoy the new features and improvements of Debian 12!

Leave a comment