How to upgrade our perfect server based on Debian 10 (Buster) to Debian 11 (Bullseye)

botond published 2023/01/31, k - 11:10 time

Content

 

The 1. page content

 

Introductory

Another era has come again, when our Debian 10 (Buster) server has also run out of time, and it has become a burning task to do something about this problem.

During the life of a web server, a lot of software is installed and configured, which takes a lot of time. Reinstalling and configuring the server from scratch, as well as restarting the web pages on it, can cause a lot of downtime, because by the time everything is in place, our web pages will not be available to our visitors. On the one hand, this is not beneficial from a business point of view, because during this time we can also lose customers, and a more permanent outage can also cause a temporary deterioration in the position of our websites in the search engines.

Fortunately, there is no problem, because most Linux distributions - like Debian - have the ability to update the entire distribution on the fly; so, for example, Deban 10 (Buster) can be upgraded to Debian 11 (Bullseye). Thanks to this, we can get away with the whole thing with a single reboot - as opposed to a lengthy installation and configuration.

I have previously made tutorials on this topic, which can be viewed at the following links:

Before starting anything, it is advisable to review these as well, because they contain a lot of useful information.

Of course, this update can also be applied to other distributions, such as Ubuntu systems. However, we should always make sure that if our system is too old, i.e. several major versions have been released since then, we should always update only one major version at a time. So, for example, if someone has a Debian 9 (Stretch) system, first upgrade to Debian 10, then repeat the whole process with an upgrade to Debian 11. Of course, in such a case, we should be even more careful, because in the case of updates through several major versions, even more things can change in the case of different releases, so we review them in each case. Accordingly, if you have, for example, a Debian 9 system, first follow the description in the link shown above that corresponds to your version.

 

 

Prerequisites

I prepared this distribution update description for a perfect server based on ISPConfig, so I will do it with the following configuration:

Starting server and the modifications and additions made to it:

The screenshots presented during the description and copied terminal outputs are produced by this configuration, so in the case of other configurations, we may get somewhat different outputs.

The configuration used here apparently contains quite a lot of add-ons and services, which makes the server very suitable for presenting a distribution update.

The guide presented here is one of my own VirtualBox on a virtual machine I perform.

 

What's new and changes in the Debian 11 (Bullseye) operating system

I would not exaggerate this part too much, because the Debian 11 (Bullseye) release was already published in August 2021, so the new features in it are probably already known to many, but we can review them again at the link below:

Before the update, it does not hurt to run through them - especially the Debian upgrade part - to make sure that all circumstances are suitable for us to upgrade.

 

Things to do before upgrading

Before we can start the upgrade, there are a few things we need to do to check if our system is up to date with the distribution, and to make sure the upgrade goes smoothly.

Hereinafter rootperform the tasks as

System overview

First, it is advisable to review our entire system and collect those functions and services that may be pivotal in terms of the update, and for the sake of comparison, it also does not hurt to take a last look at our things before the update, so that we can then check that everything really works flawlessly on our server.

Query version and release information

First, read about the kernel and Debian version and the distribution release. These can be viewed with the following commands:

uname -a
lsb_release -a
hostnamectl
cat /etc/os-release
cat /etc/debian_version

Query Debian release information before updating the distribution

Linux debian10 4.19.0-23-amd64 #1 SMP Debian 4.19.269-1 (2022-12-20) x86_64 GNU/Linux

[...]

No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 10 (buster)
Release:        10
Codename:       buster

[...]

   Static hostname: debian10
         Icon name: computer-vm
           Chassis: vm
        Machine ID: c898b9a88b1d44d3864e6dafb76e2e10
           Boot ID: 2aadf456700f487cb7b9c989bcbcbbd8
    Virtualization: oracle
  Operating System: Debian GNU/Linux 10 (buster)
            Kernel: Linux 4.19.0-23-amd64
      Architecture: x86-64

[...]

PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

[...]

10.13

Overview of websites and web applications

Here, we now review the web pages and web applications on the server.

 

 

Drupal 9 website

Since it is a web server, there must be one or more websites on it. We look at these to see if everything is in order. I have Drupal 9 on this server CMS basic installation, which does not contain anything special, I only made it for a previous installation description, so now I am checking this:

Drupal 9 website - Home page

Drupal 9 website - Administration - Status page

There are a few caveats here, but they are irrelevant here. What will change here is, for example, the version of the database engine: it will be 10 in Debian 10.3.36 and 11 in Debian 10.5.18.

ISPConfig

ISPConfig web hosting control panel:

ISPConfig - Home Page

ISPConfig - System Status

All right here. It indicates that some packages need to be updated, but this is not a problem.

phpMyAdmin

phpMyAdmin:

phpMyAdmin - Home

Here, too, we can see the system parameters at the top right, as well as the version of phpMyAdmin at the bottom right, where it also indicates that it is outdated. This copy at the time manually installed from its source code, so it is not updated. But at the end of this description, we will also solve the automatic update of this. Of course, if our own copy is already in the Debian 10 backports into storage we installed it from a package included later, then this is it APT it will be updated with the other packages using a package manager.

Roundcube Webmail

Roundcube Webmail:

Roundcube Webmail - Login

There is also an email address on this server, with which I can log in:

Roundcube Webmail - Inbox

Munin

Munin server resource monitor program:

Munin

I have used the machine here a few times in the past, so there are remnants of the graph...

 

 

Monit

Monit server service and resource monitor program

Monit - Home page

 

That's all there was to review on this server, of course everyone can check their own things according to their own config even before the update for the last time.

 

Backup

It is strongly recommended to make a backup of our important things and settings. I would not go into detail about this here again, because it was already discussed in previous tutorials, so we have already covered this in more detail on the links below:

This part is therefore independent of everything, so we can apply it from previous parts as well.

Checking packages and packages

The last major step before distributing a distribution is a luggage racks and checking, sorting, and updating packages.

Updating packages

First, update your storage database and packages as usual rootas apt-get command:

apt-get update
apt-get upgrade

I didn't have anything to update here, because I've already updated this machine several times in the past few days.

Search and update held packages

In the next step, we look for the withheld packages that the package manager does not update for some reason. If the recent upgrade command stated that certain packages will be withheld, you can find detailed instructions at the following links:

Find and remove broken packages

There may also be broken packages in the system, which are half or partially configured packages. Look for these as well and remove them if they can no longer be repaired:

dpkg --audit

If you find faulty packages, dpkg will suggest what to do with them to fix them.

Related details from previous tutorials:

He didn't find any such package with me, so I'll move on.

Search for outdated packages and possibly remove them

Obsolete packages are either no longer in the package, have been considered obsolete, or have not been installed from standard Debian repositories, such as compiled from source, and so on. We also need to review these to see if we have such packages, and if so, whether they could be a barrier to a successful distribution upgrade.

Search for obsolete packages in aptitude Or the apt-show-versions commands. All must be installed before use, none of which are installed on Debian systems by default:

apt-get install aptitude
apt-get install apt-show-versions

If they are already installed, you can use the following commands to find your obsolete packages (the first two commands are equivalent):

aptitude search '~o'
aptitude search ?obsolete
apt-show-versions | grep 'No available version'

He didn't find anything here for me:

Search for obsolete packages

I have already explained this in more detail in previous update tutorials, so let's review these parts as well:

There are as many configurations as there are situations, so it is worth reviewing them.

 

 

Search for third-party packages

Then look for third-party packages. Updating these packages in newer Debian major releases is uncertain, so they may cause problems. So we check the packages that were not installed from the official Debian repositories. Here there may be overlaps with outdated packages, for example, in the case of packages installed from a source, for which there is no update, it is also marked as outdated, and since it was not installed from the official package repository, it is also considered third-party. We can list these packages using the previously used aptitude command:

aptitude search '~i(!~ODebian)'

I have the output of this command:

Search for third-party packages

Here I only have the sury.orgThere are packages from , which are guaranteed to be updated in Debian 11, so there is nothing to do with them. However, if other packages appear in this list that we don't know if they will receive updates in the future, then we need to consider what to do with those packages. If they don't get updates to the next major version, you might want to consider replacing them with alternative software, etc.

Search for redundant packages

Even remove automatically installed package dependencies that are no longer needed by any other package:

apt autoremove

Search for redundant packages

I didn't have anything here now, because as I already mentioned, I already performed maintenance on this server in the past few days. But there is a good chance that they may occur elsewhere.

Empty the package cache

Debian was downloaded when you installed the packages .deb files are placed in a separate repository that remains there after the packages are installed. This is useful, for example, if your computer is offline later and you just need to reconfigure an existing package or perform any other package operation on it, as you will not need to connect to the Internet but will use the locally stored package, reducing network traffic. and the load on Debian mirrors. However, after a while, the size of this container can be quite fat, so it’s worth emptying it from time to time. There may be no better time to clear this cache than a full distribution upgrade, as this will cause many new packages to be downloaded, so our current packages will remain in this repository. Of course, after upgrading the entire major version, it's a good idea to run it again so that the packages you are currently using do not take up space, which the new system will no longer need.

Before emptying the packet cache, you can see its size a du You can see the free space by looking at the command and then viewing it again after cleaning. To do this, run the following commands:

du -sh /var/cache/apt/archives
apt-get clean
du -sh /var/cache/apt/archives

Roughly 420 Mb of space has now been freed up for me:

Empty the Debian package cache and check the free space

 

next page we proceed with the upgrade of the distribution to Debian 11 (Bullseye).

 

 

 

Navigation

This description consists of several pages: