Upgrade to Debian 11 from Debian 10



Published on 2021-08-30
Summary:

Upgrading from Debian 10 to Debian 11

First, update all:


sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade

Install gcc-8-base package:


sudo apt install gcc-8-base

Check the current Debian version:


cat /etc/os-release

Make backups of your repository files:


sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
sudo cp -r /etc/apt/sources.list.d /etc/apt/sources.list.d.bak

Then you have to upgrade the /etc/apt/sources.list file, and also your files which are in your /etc/apt/sources.list.d folder.

In this file, replace all references in this file from buster to bullseye, and also from buster-updates to bullseye-updates.

Example of a /etc/apt/sources.list file:


deb http://deb.debian.org/debian bullseye main
deb-src http://deb.debian.org/debian bullseye main

deb http://deb.debian.org/debian-security/ bullseye-security main
deb-src http://deb.debian.org/debian-security/ bullseye-security main

deb http://deb.debian.org/debian bullseye-updates main
deb-src http://deb.debian.org/debian bullseye-updates main

Upgrade and clean the Debian distribution:


sudo apt-get update
sudo apt-get full-upgrade


sudo apt-get autoremove

Reboot:


sudo reboot

Then, check the new Debian version:


cat /etc/os-release


With LEMP Server

If you are working with a LEMP (Linux / Nginx / MariaDB / PHP) server, here are some configuration examples you need to do.

This is an example for: Debian 11 / Nginx / MariaDB 16 / PHP 8.0 (it worked on August 2022).

And you must configure these files before upgrade the Debian distribution.

Nginx:

Do the command line:


sudo nano /etc/apt/sources.list.d/nginx.list

And in this file, put:


deb http://nginx.org/packages/debian bullseye nginx

Nginx documentation: Documentation - Install Nginx on Debian

MariaDB 10.6:

Do the command line:


sudo nano /etc/apt/sources.list.d/mariadb.list

And in this file, put:


deb [arch=amd64] https://ftp.nluug.nl/db/mariadb/repo/10.6/debian bullseye main

MariaDB documentation: Documentation - Install MariaDB 16 on Debian 11

PHP 8.0:

Do the command line:


sudo nano /etc/apt/sources.list.d/php.list

And in this file, put:


deb https://packages.sury.org/php/ bullseye main

Update an upgrade Debian distribution:

Then, proceed with the Debian distribution upgrade using the following commands:


sudo apt update
sudo apt upgrade