0

I want to upgrade my Debian system, but have been told I need to update my existing repo (Stretch) first before doing this. Unfortunately, this does not work because stretch has been archived and so my sources.list does not work. I have tried various combinations of lines trying to make the update work unsuccessfully. Other posts on the same subject only give fragmentary information about the necessary lines in sources.list. Can someone tell me the EXACT lines to use? Below is what I have and the errors reported:

   deb http://security.debian.org/debian-security stretch/updates main
   deb-src http://archive.debian.org/debian-security stretch/updates main contrib non-free 
   deb http://archive.debian.org/debian stretch-updates main contrib non-free 
   deb-src http://archive.debian.org/debian stretch-updates main contrib non-free

Errors:

W: The repository 'http://security.debian.org/debian-security stretch/updates Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://deb.debian.org/debian stretch 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.

2 Answers 2

3

According to the error messages, the problems are with two lines not referring to archive.debian.org.

First problem line:

deb http://security.debian.org/debian-security stretch/updates main

Since regular security support for Debian Stretch ended on July 18, 2020. and even the Long Term Support ended at the end of June 2022, you should comment out this line for now: it serves no further purpose while you're still running Debian Stretch, but once you upgrade to a newer major release (twice), it can be uncommented and updated to point to that release's security update repository.

To receive whatever security updates were not merged in the last 9.13 release of Stretch, you should add this line:

deb [trusted=yes] http://archive.debian.org/debian-security stretch/updates main 

You will probably have to add [trusted=yes] to any lines referring to Stretch in archive.debian.org, since the GPG keys that were used to sign packages for Stretch are most likely all expired by now. Adding that should change the error message about expired keys into a warning, and allow you to proceed with the update.

The second problem line according to the error messages is not visible in your sources.list snippet, but I can deduce it's probably:

deb http://deb.debian.org/debian stretch main contrib non-free

This line might be in one of the files in /etc/apt/sources.list.d/ directory. You should change it to:

deb [trusted=yes] http://archive.debian.org/debian stretch main contrib non-free

The deb lines in yor sources.list snippet cover security and other updates, but not the main release content; this line will cover that.

If you don't need to build any *.deb packages from source, you can comment out the deb-srclines.

Remember that skipping over major releases is not supported, so once you're fully up to date in Stretch 9.13, you should perform a major upgrade to Debian 10 "Buster", which still has long-term support until the end of June of this year. Remember to pay attention to the upgrade instructions in the Release Notes if/when you perform the upgrade.

From there, the next step should be Debian 11 "Bullseye", which is the current oldstable and still has regular security support until end of July of this year, and long-term support for two years after that.

1
  • The Stretch keys are still OK, there’s no need to specify [trusted=yes]. Commented Apr 23 at 21:21
2

The lines you need are

deb http://archive.debian.org/debian stretch main
deb http://archive.debian.org/debian-security stretch/updates main

If you need contrib and non-free, add them to the end of both lines.

2
  • should I just delete the deb-src lines then? Commented Apr 23 at 19:37
  • You don’t need them to upgrade Stretch before an upgrade to another release. You only need them if you want apt-get source to work. If you do want them, copy the two lines above and replace deb with deb-src at the beginning of the copies. Commented Apr 23 at 21:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .