If you have to administrate legacy Debian servers, that keeps hanging either for historical reasons or just because you didn't have time to upgrade it up to latest versions, machines that are hanging in the hangar or a mid office building Old server room, doing nothing but simply NAT (Network Address Translation), Proxying, serving traffic via Squid / Haproxy / Apache / Varnish or Nginx server but you still want to have the possibility to extend the OS even though it is out of date / End of Life reached and out of support as well as perhaps full of security holes, but due to its unvisibility on the Internet hanging in a Demilitarized network the machine stayed on the Local (DMZ)-ed network and still for example you need to install simple things for administration reasons locally on the machine, for example nmap or netcat or some of the network tools for monitoring such as iftop or iptraf etc. you might find out unfortunately that this is not possible anymore, because the configured /etc/apt/sources.list repository mirror is no longer available at its URL. Thus to restore the functioning of apt and apt-get pkg management tools on Debian you need to correct the broken missing package mirrors due to resructurings on the network with a correct ones, originally provided by Debian or eventually if this doesn't work a possible Debian package archive URL.
In this article, I'll simply provide such URLs you might use to correct your no longer functioning package manager due to package repositoriy unavailibility, below are the URLs (most of which that should be working as of year 2024). To resolve the issues edit and place the correct Debian version you're using.
1. Check the version of the Debian Linux
# cat /etc/debian_version
…
or use the universal way to check the linux OS, that should be working on almost all Linux distributions
# cat /etc/issue
Debian GNU/Linux 9 \n \l
2. Modify /etc/apt/sources.list and place URL according to Debian distro version
# vim /etc/apt/sources.list
3. Repositories URL list Original and Archived for .deb packages according to Debian distro release
Debian 6 (Wheezy)
Original repostiroes (Not Available and Not working anymore as of year 2024)
Old Archived .deb repository for 6 Squeeze
deb http://archive.debian.org/debian squeeze main
deb http://archive.debian.org/debian squeeze-lts main
Debian 7 (Wheezy)
Original repostiroes (Not Available and Not working anymore as of year 2024)
Old Archived .deb repository for Jessie (still working as of 2024) :
deb http://archive.debian.org/debian wheezy main contrib non-free
deb http://archive.debian.org/debian-security wheezy/updates main
( Security updates are not provided anymore.)
NOTE: If you get an error about keyrings, just install it
# apt-get install debian-archive-keyring
Debian 8 (Jessie)
Original .deb package repository with non-free included for Debian 8 "Jessie"
deb http://deb.debian.org/debian/ jessie main contrib non-free
deb http://ftp.debian.org/debian/ jessie-updates main contrib
deb http://security.debian.org/ jessie/updates main contrib non-free
Old Archived .deb repository for 8 Jessie (still working as of 2024):
deb http://archive.debian.org/debian/ jessie main non-free contrib
deb-src http://archive.debian.org/debian/ jessie main non-free contrib
deb http://archive.debian.org/debian-security/ jessie/updates main non-free contrib
deb-src http://archive.debian.org/debian-security/ jessie/updates main non-free contrib
# echo "Acquire::Check-Valid-Until false;" | tee -a /etc/apt/apt.conf.d/10-nocheckvalid
# apt-get update
# apt-get update && apt-get upgrade
If you need backports, first be warned that these are archived and no longer being updated; they may have security bugs or other major issues. They are not supported in any way.
deb http://archive.debian.org/debian/ jessie-backports main
Debian 9 (Stretch)
Original .deb package repository with non-free included for Debian 9 "Stretch":
deb http://deb.debian.org/debian/ stretch main contrib non-free
deb http://deb.debian.org/debian/ stretch-updates main contrib non-free
deb http://security.debian.org/ stretch/updates main contrib non-free
Archived old repository .deb for Stretch :
deb http://archive.debian.org/debian/ stretch main contrib non-free
deb http://archive.debian.org/debian/ stretch-proposed-updates main contrib non-free
deb http://archive.debian.org/debian-security stretch/updates main contrib non-free
Debian 10 (Buster)
Origian repository URL:
deb http://deb.debian.org/debian/ buster main non-free contrib
deb http://deb.debian.org/debian/ buster-updates main non-free contrib
deb http://security.debian.org/ buster/updates main non-free contrib
Fixing unworking backports for Debian 10 Buster
Change the /etc/apt/sources.list URL with this one
deb http://archive.debian.org/debian buster-backports main contrib non-free
If you want to list packages installed via the backports repository only, that needs to be replaced with newer versions (if such available from the repository)
# apt list –installed | grep backports
# dpkg –list | grep bpo
# dpkg –list | grep -E '^ii.*bpo.*'ii libpopt0:amd64 1.18-2 amd64 lib for parsing cmdline parameters
ii libuutil3linux 2.0.3-9~bpo10+1 amd64 Solaris userland utility library for Linux
ii libzfs4linux 2.0.3-9~bpo10+1 amd64 OpenZFS filesystem library for Linux
Debian 11 (Bullseye)
Origianl repository address:
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
Debian 12 (Bookworm)
Original Repository :
deb http://deb.debian.org/debian bookworm main contrib non-free-firmware non-free
deb http://deb.debian.org/debian bookworm-updates main contrib non-free-firmware non-free
deb http://security.debian.org/debian-security bookworm-security main contrib non-free-firmware non-free
Add Backports to sources.list
deb http://deb.debian.org/debian bookworm-backports main
Thats all, hopefully that would help some sysadmin out there. Enjoy !