Hi there,
You have this old server, it does it's job correctly and you forgot about it. More important, you forget to update it's packages from time to time.
Well, you remember about it but meanwhile this OS has become obsolete and the apt sources are not valid anymore. What to do?
Create another server with new OS and migrate the application/data?
Upgrade the existing server?
Hold on, you do not want to upgrade for now? Just want to update the existing OS? OK, I have a solution for that too.
The solution that does not involves OS upgrade (yet)
Old releases are archived and there is a page that explains that: https://www.debian.org/distrib/archive.
Still not clear? Ok, let's have an example.
This server is old, version 9 of Debian called Stretch and the apt update command fails because the packages for this release are no more in the main repository:
11:10:10 root@jupiter:~# cat /etc/debian_version 9.13 11:10:15 root@jupiter:~# cat /etc/apt/sources.list deb http://ftp.us.debian.org/debian/ stretch main non-free contrib deb-src http://ftp.us.debian.org/debian/ stretch main non-free contrib deb http://security.debian.org/ stretch/updates main contrib non-free deb-src http://security.debian.org/ stretch/updates main contrib non-free # stretch-updates, previously known as 'volatile' deb http://ftp.us.debian.org/debian/ stretch-updates main contrib non-free deb-src http://ftp.us.debian.org/debian/ stretch-updates main contrib non-free 11:10:20 root@jupiter:~# apt update Ign:1 http://security.debian.org stretch/updates InRelease Ign:2 http://ftp.debian.org/debian stretch-backports InRelease Err:3 http://security.debian.org stretch/updates Release 404 Not Found Err:4 http://ftp.debian.org/debian stretch-backports Release 404 Not Found Hit:5 https://download.docker.com/linux/debian stretch InRelease Ign:6 http://ftp.us.debian.org/debian stretch InRelease Ign:7 http://ftp.us.debian.org/debian stretch-updates InRelease Err:8 http://ftp.us.debian.org/debian stretch Release 404 Not Found Err:9 http://ftp.us.debian.org/debian stretch-updates Release 404 Not Found Reading package lists... Done E: The repository 'http://security.debian.org stretch/updates Release' does no longer have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. E: The repository 'http://ftp.debian.org/debian stretch-backports Release' does no longer have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. E: The repository 'http://ftp.us.debian.org/debian stretch Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. E: The repository 'http://ftp.us.debian.org/debian stretch-updates Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.
All I have to do now is to remove all those entries in /etc/apt/sources.list, consult the page mentioned above and put there the archived repository for stretch.
11:14:52 root@jupiter:~# cat /etc/apt/sources.list deb http://archive.debian.org/debian/ stretch contrib main non-free 11:14:57 root@jupiter:~# apt update Ign:1 http://archive.debian.org/debian stretch InRelease Hit:2 http://archive.debian.org/debian stretch Release Hit:3 https://download.docker.com/linux/debian stretch InRelease Reading package lists... Done Building dependency tree Reading state information... Done All packages are up to date.
Yey, no errors! No updates tho...