Upgrading Debian 10 to Debian 11
Overview
This page provides a step-by-step guide for the distribution upgrade from Debian 10 to Debian 11, tailored to the minimal set of packages that are required for Cryptshare for Mail Gateway. To see the full official guide, visit the Debian 11 release notes.
Preparation
-
Create a backup or snapshot of the system before installing, so that you can restore the initial state easily.
-
Inform your users about the system downtime, which will be around 1–2 hours depending on the speed of the internet connection. During the upgrade, messages will not be delivered reliably.
Upgrade Steps
-
Become root:
sudo su
-
Remove unofficial packages. Their configuration files remain:
apt remove ansible apt remove postfix apt autoremove
-
Clean up
/etc/apt/sources.listand replace its contents with:
deb http://deb.debian.org/debian/ buster main deb-src http://deb.debian.org/debian/ buster main deb http://security.debian.org/debian-security buster/updates main deb-src http://security.debian.org/debian-security buster/updates main deb http://deb.debian.org/debian/ buster-updates main deb-src http://deb.debian.org/debian/ buster-updates main
-
Update to the latest Buster packages:
apt update apt upgrade apt full-upgrade apt autoremove reboot
-
Become root again:
sudo su
-
Replace the contents of
/etc/apt/sources.listwith:
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://security.debian.org/debian-security bullseye-security main contrib non-free
-
Perform the upgrade:
apt clean apt update apt full-upgrade
-
Shortly after the package information is loaded, release notes are displayed. Confirm them with the
Qkey. -
Answer questions during package upgrades.
-
Questions like this:
-
Configuration file '/etc/powerdns/recursor.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.
*** recursor.conf (Y/I/N/O/D/Z) [default=N] ?
-
For
/etc/resolvconf/resolv.conf.d/head:N -
For
/etc/opendkim.conf:N -
For
/etc/opendmarc.conf:N -
For
/etc/powerdns/recursor.conf:N -
Question about dbconfig-common for OpenDMARC:
No -
Question about libc6 upgrade:
Yes -
Question about libc6 automated restarts:
Yes
-
Reboot:
reboot
-
Become root again:
sudo su
-
Install Postfix and the SPF daemon again:
apt install postfix # -> Answer question with "No configuration" apt install postfix-pgsql apt install postfix-policyd-spf-python
-
Update PostgreSQL.
Stop services:
systemctl stop cmg-filter systemctl stop postgresql
Start the upgrade:
su postgres cd /tmp /usr/lib/postgresql/13/bin/pg_upgrade --old-datadir=/var/lib/postgresql/11/main --new-datadir=/var/lib/postgresql/13/main --old-bindir=/usr/lib/postgresql/11/bin --new-bindir=/usr/lib/postgresql/13/bin --old-options '-c config_file=/etc/postgresql/11/main/postgresql.conf' --new-options '-c config_file=/etc/postgresql/13/main/postgresql.conf' exit
Remove the old installation:
apt purge postgresql-11 # -> Answer question with yes, remove configuration files apt purge postgresql-client-11 /tmp/delete_old_cluster.sh
Edit /etc/postgresql/13/main/postgresql.conf and change the port back to the default:
... port = 5432 ...
Restart the PostgreSQL service:
systemctl restart postgresql
-
Reboot one last time:
reboot