After the installation of Debian 11 Bullseye on a Virtualized Infrastructure or a physical machine you’ll notice APT repositories are not configured correctly. These issue doesn’t apply to Cloud images which have repositories for Debian 11 (Bullseye) configured correctly. In this guide we will show you how to add Debian 11 Bullseye Official repositories to sources.list.
If you attempt APT repository update you’ll get an error as shown in the screenshot.
The remedy to this problem is correctly updating sources.list file with Debian 11 (Bullseye) default update and security repositories.
Current file contents:
$ cat /etc/apt/sources.list # deb cdrom:[Debian GNU/Linux 11.0.0 _Bullseye_ - Official amd64 DVD Binary-1 20210814-10:04]/ bullseye contrib main deb cdrom:[Debian GNU/Linux 11.0.0 _Bullseye_ - Official amd64 DVD Binary-1 20210814-10:04]/ bullseye contrib main deb http://security.debian.org/debian-security bullseye-security main contrib deb-src http://security.debian.org/debian-security bullseye-security main contrib # bullseye-updates, to get updates before a point release is made; # see https://www.debian.org/doc/manuals/debian-reference/ch02.en.html#_updates_and_backports # A network mirror was not selected during install. The following entries # are provided as examples, but you should amend them as appropriate # for your mirror of choice. # # deb http://deb.debian.org/debian/ bullseye-updates main contrib # deb-src http://deb.debian.org/debian/ bullseye-updates main contrib
Add Debian 11 Bullseye Official repositories to sources.list
Run the commands below to add Debian 11 Bullseye Official repositories to sources.list
sudo tee /etc/apt/sources.list<<EOF deb http://deb.debian.org/debian bullseye main deb-src http://deb.debian.org/debian bullseye main deb http://security.debian.org/debian-security bullseye-security main deb-src http://security.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 deb http://deb.debian.org/debian bullseye-backports main deb-src http://deb.debian.org/debian bullseye-backports main EOF
When done, update your APT index to confirm the repositories are working correctly:
$ sudo apt update Get:1 http://deb.debian.org/debian bullseye InRelease [113 kB] Get:2 http://security.debian.org/debian-security bullseye-security InRelease [44.1 kB] Get:3 http://deb.debian.org/debian bullseye-updates InRelease [36.8 kB] Get:4 http://deb.debian.org/debian bullseye-backports InRelease [40.9 kB] Get:5 http://security.debian.org/debian-security bullseye-security/main Sources [15.8 kB] Get:6 http://security.debian.org/debian-security bullseye-security/main amd64 Packages [31.1 kB] Get:7 http://security.debian.org/debian-security bullseye-security/main Translation-en [16.8 kB] Get:8 http://deb.debian.org/debian bullseye/main Sources [8612 kB] Get:9 http://deb.debian.org/debian bullseye/main amd64 Packages [8178 kB] Get:10 http://deb.debian.org/debian bullseye/main Translation-en [6241 kB] Get:11 http://deb.debian.org/debian bullseye-backports/main Sources [49.8 kB] Get:12 http://deb.debian.org/debian bullseye-backports/main amd64 Packages [68.7 kB] Get:13 http://deb.debian.org/debian bullseye-backports/main Translation-en [50.5 kB] Fetched 23.5 MB in 5s (4978 kB/s) Reading package lists... Done Building dependency tree... Done Reading state information... Done 3 packages can be upgraded. Run 'apt list --upgradable' to see them.
With the official OS repositories added and confirmed to be working let’s update the system packages:
sudo apt upgrade
You can also try distribution minor upgrades if available
sudo apt dist-upgrade
Also install common OS administration tools
sudo apt install git curl bash-completion wget curl vim telnet -y
You now have correct sources.list file on your Debian 11 (Bullseye( system.