Fixing the “Ubuntu Repository No Longer Has a Release” Issue

Introduction

In this tutorial, How to fix the Ubuntu repository no longer has a Release.

Ubuntu, a widely used Linux distribution, relies on repositories to provide software packages and updates. Occasionally, you might encounter the error message “Ubuntu repository no longer has a release,” indicating that the repository you’re trying to access is unavailable or unsupported. This article delves into the reasons behind this issue and offers potential solutions to address it effectively.

Today, I am installing Nginx, But suddenly one day you use this command and get the following error:

“>
vagrant@controller:~$ sudo apt install nginx -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  libnginx-mod-http-geoip2 libnginx-mod-http-image-filter libnginx-mod-http-xslt-filter libnginx-mod-mail
  libnginx-mod-stream libnginx-mod-stream-geoip2 nginx-common nginx-core
Suggested packages:
  fcgiwrap nginx-doc ssl-cert
The following NEW packages will be installed:
  libnginx-mod-http-geoip2 libnginx-mod-http-image-filter libnginx-mod-http-xslt-filter libnginx-mod-mail
  libnginx-mod-stream libnginx-mod-stream-geoip2 nginx nginx-common nginx-core
0 upgraded, 9 newly installed, 0 to remove and 0 not upgraded.
Need to get 700 kB of archives.
After this operation, 2386 kB of additional disk space will be used.
Ign:1 http://archive.ubuntu.com/ubuntu impish-updates/main amd64 nginx-common all 1.18.0-6ubuntu11.1
Ign:2 http://archive.ubuntu.com/ubuntu impish-updates/main amd64 libnginx-mod-http-geoip2 amd64 1.18.0-6ubuntu11.1
Ign:3 http://archive.ubuntu.com/ubuntu impish-updates/main amd64 libnginx-mod-http-image-filter amd64 1.18.0-6ubuntu11.1Ign:4 http://archive.ubuntu.com/ubuntu impish-updates/main amd64 libnginx-mod-http-xslt-filter amd64 1.18.0-6ubuntu11.1
Ign:5 http://archive.ubuntu.com/ubuntu impish-updates/main amd64 libnginx-mod-mail amd64 1.18.0-6ubuntu11.1
Ign:6 http://archive.ubuntu.com/ubuntu impish-updates/main amd64 libnginx-mod-stream amd64 1.18.0-6ubuntu11.1
Ign:7 http://archive.ubuntu.com/ubuntu impish-updates/main amd64 libnginx-mod-stream-geoip2 amd64 1.18.0-6ubuntu11.1
Ign:8 http://archive.ubuntu.com/ubuntu impish-updates/main amd64 nginx-core amd64 1.18.0-6ubuntu11.1
Ign:9 http://archive.ubuntu.com/ubuntu impish-updates/main amd64 nginx amd64 1.18.0-6ubuntu11.1
Err:1 http://security.ubuntu.com/ubuntu impish-updates/main amd64 nginx-common all 1.18.0-6ubuntu11.1
  404  Not Found [IP: 91.189.91.39 80]
Err:2 http://security.ubuntu.com/ubuntu impish-updates/main amd64 libnginx-mod-http-geoip2 amd64 1.18.0-6ubuntu11.1
  404  Not Found [IP: 91.189.91.39 80]
Err:3 http://security.ubuntu.com/ubuntu impish-updates/main amd64 libnginx-mod-http-image-filter amd64 1.18.0-6ubuntu11.1
  404  Not Found [IP: 91.189.91.39 80]
Err:4 http://security.ubuntu.com/ubuntu impish-updates/main amd64 libnginx-mod-http-xslt-filter amd64 1.18.0-6ubuntu11.1  404  Not Found [IP: 91.189.91.39 80]
Err:5 http://security.ubuntu.com/ubuntu impish-updates/main amd64 libnginx-mod-mail amd64 1.18.0-6ubuntu11.1
  404  Not Found [IP: 91.189.91.39 80]
Err:6 http://security.ubuntu.com/ubuntu impish-updates/main amd64 libnginx-mod-stream amd64 1.18.0-6ubuntu11.1
  404  Not Found [IP: 91.189.91.39 80]
  404  Not Found [IP: 91.189.91.39 80]
Err:9 http://security.ubuntu.com/ubuntu impish-updates/main amd64 nginx amd64 1.18.0-6ubuntu11.1
  404  Not Found [IP: 91.189.91.39 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/n/nginx/nginx-common_1.18.0-6ubuntu11.1_all.deb  404  Not Found [IP: 91.189.91.39 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/n/nginx/libnginx-mod-http-geoip2_1.18.0-6ubuntu11.1_amd64.deb  404  Not Found [IP: 91.189.91.39 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/n/nginx/libnginx-mod-http-image-filter_1.18.0-6ubuntu11.1_amd64.deb  404  Not Found [IP: 91.189.91.39 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/n/nginx/libnginx-mod-http-xslt-filter_1.18.0-6ubuntu11.1_amd64.deb  404  Not Found [IP: 91.189.91.39 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/n/nginx/libnginx-mod-mail_1.18.0-6ubuntu11.1_amd64.deb  404  Not Found [IP: 91.189.91.39 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/n/nginx/libnginx-mod-stream_1.18.0-6ubuntu11.1_amd64.deb  404  Not Found [IP: 91.189.91.39 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/n/nginx/libnginx-mod-stream-geoip2_1.18.0-6ubuntu11.1_amd64.deb  404  Not Found [IP: 91.189.91.39 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/n/nginx/nginx-core_1.18.0-6ubuntu11.1_amd64.deb  404  Not Found [IP: 91.189.91.39 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/n/nginx/nginx_1.18.0-6ubuntu11.1_amd64.deb  404  Not Found [IP: 91.189.91.39 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

Cause: older releases of Ubuntu moved to a new host.

If you encounter an issue where the Ubuntu repository no longer has a “Release” file, it could be due to a temporary problem with the repository or a misconfiguration on your system. Here are a few steps you can take to troubleshoot and potentially resolve the issue:

Ubuntu repository no longer has a Release fixed

Step 1. Backup file sources.list

cp /etc/apt/sources.list /etc/apt/sources.list.bak

Step 2. Replace the links with the new repository address.

sudo sed -i -re 's/([a-z]{2}.)?archive.ubuntu.com|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list

Step 3. Update OS after steps 1 and step 2.

sudo apt-get update && sudo apt-get dist-upgrade

At this point, when you see that command 3 has run successfully, you can completely select Y to continue the update process for your Ubuntu server. Or select N to cancel the update process.

As a result, the fixed repository no longer has a Release file on Ubuntu Server. For example, I select Y.

Ubuntu repository no longer has a Release fixed
root@controller:~# sudo apt-get update && sudo apt-get dist-upgrade
Get:1 http://old-releases.ubuntu.com/ubuntu impish InRelease [270 kB]
Hit:2 https://apache.jfrog.io/artifactory/couchdb-deb focal InRelease
Get:3 http://old-releases.ubuntu.com/ubuntu impish-updates InRelease [115 kB]
Get:4 http://old-releases.ubuntu.com/ubuntu impish-backports InRelease [101 kB]
Get:5 http://old-releases.ubuntu.com/ubuntu impish-security InRelease [110 kB]
Get:6 http://old-releases.ubuntu.com/ubuntu impish/main amd64 Packages [1396 kB]
Get:7 http://old-releases.ubuntu.com/ubuntu impish/main Translation-en [511 kB]
Get:8 http://old-releases.ubuntu.com/ubuntu impish/main amd64 c-n-f Metadata [29.8 kB]
Get:9 http://old-releases.ubuntu.com/ubuntu impish/restricted amd64 Packages [82.2 kB]
Get:44 http://old-releases.ubuntu.com/ubuntu impish-security/universe amd64 c-n-f Metadata [5396 B]
Get:45 http://old-releases.ubuntu.com/ubuntu impish-security/multiverse amd64 Packages [4776 B]
Get:46 http://old-releases.ubuntu.com/ubuntu impish-security/multiverse Translation-en [988 B]
Get:47 http://old-releases.ubuntu.com/ubuntu impish-security/multiverse amd64 c-n-f Metadata [228 B]
Fetched 23.4 MB in 1min 34s (248 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  git git-man libpython3.9 libpython3.9-minimal libpython3.9-stdlib python3-distupgrade python3.9 python3.9-minimal
  ubuntu-release-upgrader-core
9 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
7 standard security updates
Need to get 11.1 MB of archives.
After this operation, 24.6 kB disk space will be freed.
Do you want to continue? [Y/n] y
Get:1 http://old-releases.ubuntu.com/ubuntu impish-updates/main amd64 python3.9 amd64 3.9.7-2ubuntu0.1 [433 kB]
Get:2 http://old-releases.ubuntu.com/ubuntu impish-updates/main amd64 libpython3.9 amd64 3.9.7-2ubuntu0.1 [1897 kB]
Get:3 http://old-releases.ubuntu.com/ubuntu impish-updates/main amd64 libpython3.9-stdlib amd64 3.9.7-2ubuntu0.1 [1807 kB]
Get:4 http://old-releases.ubuntu.com/ubuntu impish-updates/main amd64 python3.9-minimal amd64 3.9.7-2ubuntu0.1 [2058 kB]
Get:5 http://old-releases.ubuntu.com/ubuntu impish-updates/main amd64 libpython3.9-minimal amd64 3.9.7-2ubuntu0.1 [783 kB]
Get:6 http://old-releases.ubuntu.com/ubuntu impish-updates/main amd64 ubuntu-release-upgrader-core all 1:21.10.10 [25.5 kB]
Get:7 http://old-releases.ubuntu.com/ubuntu impish-updates/main amd64 python3-distupgrade all 1:21.10.10 [104 kB]
Get:8 http://old-releases.ubuntu.com/ubuntu impish-updates/main amd64 git-man all 1:2.32.0-1ubuntu1.3 [943 kB]
Get:9 http://old-releases.ubuntu.com/ubuntu impish-updates/main amd64 git amd64 1:2.32.0-1ubuntu1.3 [3038 kB]
Fetched 11.1 MB in 50s (221 kB/s)
(Reading database ... 99174 files and directories currently installed.)
Preparing to unpack .../0-python3.9_3.9.7-2ubuntu0.1_amd64.deb ...
Unpacking python3.9 (3.9.7-2ubuntu0.1) over (3.9.7-2build1) ...
Preparing to unpack .../1-libpython3.9_3.9.7-2ubuntu0.1_amd64.deb ...
Unpacking libpython3.9:amd64 (3.9.7-2ubuntu0.1) over (3.9.7-2build1) ...
Preparing to unpack .../2-libpython3.9-stdlib_3.9.7-2ubuntu0.1_amd64.deb ...
Unpacking libpython3.9-stdlib:amd64 (3.9.7-2ubuntu0.1) over (3.9.7-2build1) ...
Preparing to unpack .../3-python3.9-minimal_3.9.7-2ubuntu0.1_amd64.deb ...
Unpacking python3.9-minimal (3.9.7-2ubuntu0.1) over (3.9.7-2build1) ...
Preparing to unpack .../4-libpython3.9-minimal_3.9.7-2ubuntu0.1_amd64.deb ...
Unpacking libpython3.9-minimal:amd64 (3.9.7-2ubuntu0.1) over (3.9.7-2build1) ...
Preparing to unpack .../5-ubuntu-release-upgrader-core_1%3a21.10.10_all.deb ...
Unpacking ubuntu-release-upgrader-core (1:21.10.10) over (1:21.10.9) ...
Preparing to unpack .../6-python3-distupgrade_1%3a21.10.10_all.deb ...
Unpacking python3-distupgrade (1:21.10.10) over (1:21.10.9) ...
Preparing to unpack .../7-git-man_1%3a2.32.0-1ubuntu1.3_all.deb ...
Unpacking git-man (1:2.32.0-1ubuntu1.3) over (1:2.32.0-1ubuntu1.2) ...
Preparing to unpack .../8-git_1%3a2.32.0-1ubuntu1.3_amd64.deb ...
Unpacking git (1:2.32.0-1ubuntu1.3) over (1:2.32.0-1ubuntu1.2) ...
Setting up libpython3.9-minimal:amd64 (3.9.7-2ubuntu0.1) ...
Setting up python3-distupgrade (1:21.10.10) ...
Setting up ubuntu-release-upgrader-core (1:21.10.10) ...
Setting up git-man (1:2.32.0-1ubuntu1.3) ...
Setting up python3.9-minimal (3.9.7-2ubuntu0.1) ...
Setting up libpython3.9-stdlib:amd64 (3.9.7-2ubuntu0.1) ...
Setting up libpython3.9:amd64 (3.9.7-2ubuntu0.1) ...
Setting up git (1:2.32.0-1ubuntu1.3) ...
Setting up python3.9 (3.9.7-2ubuntu0.1) ...
Processing triggers for man-db (2.9.4-2) ...
Processing triggers for libc-bin (2.34-0ubuntu3.2) ...
Scanning processes...
Scanning candidates...
Scanning linux images...

Running kernel seems to be up-to-date.

Restarting services...
Service restarts being deferred:
 systemctl restart networkd-dispatcher.service
 systemctl restart unattended-upgrades.service

No containers need to be restarted.

No user sessions are running outdated binaries.

Via Youtube

Conclusion

By understanding the potential causes and implementing the solutions provided in this article, you can address the issue and restore the functionality of your package manager.

Whether it’s removing unsupported repositories, updating URLs, ensuring network connectivity, or waiting for temporary issues to be resolved, these steps will help you navigate and resolve the error efficiently.

You have a fixed repository no longer has a Release file on Ubuntu. I hope will this your helpful. Thank you for reading the DevopsRoles page!

, ,

About HuuPV

My name is Huu. I love technology and especially Devops Skill such as Docker, vagrant, git so forth. I likes open-sources. so I created DevopsRoles.com site to share the knowledge that I have learned. My Job: IT system administrator. Hobbies: summoners war game, gossip.
View all posts by HuuPV →

2 thoughts on “Fixing the “Ubuntu Repository No Longer Has a Release” Issue

  1. hello, i did this without backing up first, so how do i undo this
    sudo sed -i -re ‘s/([a-z]{2}.)?archive.ubuntu.com|security.ubuntu.com/old-releases.ubuntu.com/g’ /etc/apt/sources.list

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.