The repository ‘ stretch Release’ no longer has a Release file

This how to helps you to learn fixing the error message “The repository ‘ stretch Release’ no longer has a Release file.” 

Debian 9.0 Stretch

Debian 9.0 Stretch

Index Of How To Fix The repository ‘ stretch Release’ no longer has a Release file


Debian 9 (Stretch) transitioned to legacy status after the release of Debian 10 (Buster):

  • Debian 9 (Stretch) was officially superseded by Debian 10 (Buster) on July 6th, 2019.
  • Security updates for Stretch were discontinued as of July 6th, 2020.
  • Stretch benefited from Long-Term Support (LTS) until the end of June 2022. The LTS support was limited to specific architectures: i386, amd64, armel, armhf, and arm641.
  • Stretch is no longer actively maintained, it served as a stable and reliable release during its time!

How To Fix The repository ‘ stretch Release’ no longer has a Release file

There are two ways to fix this error message. The best way is to upgrade to a newer Debian version, e.g. Debian 11 (Bullseye) or Debian 12 (Bookworm).

1. Option: Switch to Legacy – Not Recommended since Stretch is no longer actively maintained

sudo vi /etc/apt/sources.list

Replace stretch Release


deb stretch main contrib non-free rpi

fire the comment 

udo apt upgrade

2. Option: Upgrade to Debian 12 Bookworm – Recommended since it is actively maintained

First, and before doing anything, you should backup all your data. Please do not execute any of the below if you did not made a backup.

Edit the sources.list

sudo vi /etc/apt/sources.list

Add the following lines:
deb bookworm main
deb-src bookworm main

Following this, you like to execute the below three comments in exactly the order as they are listed in the below:
sudo apt update
sudo apt upgrade
sudo apt dist-upgrade

Additional Information

In case you get a key error like the below

Err:2 bookworm InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131 NO_PUBKEY F8D2585B8783D481

This solution (that I found in the internet) helped me to fix it. I basically added by this the 3 missing keys:

gpg --armor --export 0E98404D386FA1D9 | sudo apt-key add -
gpg --armor --export 6ED0E7B82643E131 | sudo apt-key add -
gpg --armor --export F8D2585B8783D481 | sudo apt-key add -

Follow me

It would be amazing if you follow my To my blog is actually easy! You can leverage on

  • Click to follow me on Twitter
  • Bookmark this page and comeback from time to time

Help and Comments

I am really looking forward for you to contact me if for example you found a better option or other idea then in this how to. Also, please touch base if you found an error or anything not working or if you have something that you would love to be added to the Simply click this link to touch base with me.

Linking Or Recommending The How To Or The

I would love to see you are recommending this how to or link it to your website. Also, I would love if you link or recommend the whole Please feel free to do so! In case you like to touch base regarding this topic with me, then simply click this link. I look forward!