#Introduction
In this tutorial, How to fix Ubuntu repository no longer has a Release.
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]
Err:7 http://security.ubuntu.com/ubuntu impish-updates/main amd64 libnginx-mod-stream-geoip2 amd64 1.18.0-6ubuntu11.1
404 Not Found [IP: 91.189.91.39 80]
Err:8 http://security.ubuntu.com/ubuntu impish-updates/main amd64 nginx-core amd64 1.18.0-6ubuntu11.1
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,
Ubuntu repository no longer has a Release fixed
1.Backup file sources.list
cp /etc/apt/sources.list /etc/apt/sources.list.bak
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
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.

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:10 http://old-releases.ubuntu.com/ubuntu impish/restricted Translation-en [11.9 kB]
Get:11 http://old-releases.ubuntu.com/ubuntu impish/restricted amd64 c-n-f Metadata [452 B]
Get:12 http://old-releases.ubuntu.com/ubuntu impish/universe amd64 Packages [13.1 MB]
Get:13 http://old-releases.ubuntu.com/ubuntu impish/universe Translation-en [5463 kB]
Get:14 http://old-releases.ubuntu.com/ubuntu impish/universe amd64 c-n-f Metadata [279 kB]
Get:15 http://old-releases.ubuntu.com/ubuntu impish/multiverse amd64 Packages [209 kB]
Get:16 http://old-releases.ubuntu.com/ubuntu impish/multiverse Translation-en [108 kB]
Get:17 http://old-releases.ubuntu.com/ubuntu impish/multiverse amd64 c-n-f Metadata [8124 B]
Get:18 http://old-releases.ubuntu.com/ubuntu impish-updates/main amd64 Packages [306 kB]
Get:19 http://old-releases.ubuntu.com/ubuntu impish-updates/main Translation-en [93.1 kB]
Get:20 http://old-releases.ubuntu.com/ubuntu impish-updates/main amd64 c-n-f Metadata [8040 B]
Get:21 http://old-releases.ubuntu.com/ubuntu impish-updates/restricted amd64 Packages [104 kB]
Get:22 http://old-releases.ubuntu.com/ubuntu impish-updates/restricted Translation-en [14.1 kB]
Get:23 http://old-releases.ubuntu.com/ubuntu impish-updates/restricted amd64 c-n-f Metadata [560 B]
Get:24 http://old-releases.ubuntu.com/ubuntu impish-updates/universe amd64 Packages [255 kB]
Get:25 http://old-releases.ubuntu.com/ubuntu impish-updates/universe Translation-en [77.7 kB]
Get:26 http://old-releases.ubuntu.com/ubuntu impish-updates/universe amd64 c-n-f Metadata [6648 B]
Get:27 http://old-releases.ubuntu.com/ubuntu impish-updates/multiverse amd64 Packages [7796 B]
Get:28 http://old-releases.ubuntu.com/ubuntu impish-updates/multiverse Translation-en [2072 B]
Get:29 http://old-releases.ubuntu.com/ubuntu impish-updates/multiverse amd64 c-n-f Metadata [420 B]
Get:30 http://old-releases.ubuntu.com/ubuntu impish-backports/main amd64 c-n-f Metadata [112 B]
Get:31 http://old-releases.ubuntu.com/ubuntu impish-backports/restricted amd64 c-n-f Metadata [116 B]
Get:32 http://old-releases.ubuntu.com/ubuntu impish-backports/universe amd64 Packages [4832 B]
Get:33 http://old-releases.ubuntu.com/ubuntu impish-backports/universe Translation-en [2724 B]
Get:34 http://old-releases.ubuntu.com/ubuntu impish-backports/universe amd64 c-n-f Metadata [496 B]
Get:35 http://old-releases.ubuntu.com/ubuntu impish-backports/multiverse amd64 c-n-f Metadata [116 B]
Get:36 http://old-releases.ubuntu.com/ubuntu impish-security/main amd64 Packages [238 kB]
Get:37 http://old-releases.ubuntu.com/ubuntu impish-security/main Translation-en [71.3 kB]
Get:38 http://old-releases.ubuntu.com/ubuntu impish-security/main amd64 c-n-f Metadata [5884 B]
Get:39 http://old-releases.ubuntu.com/ubuntu impish-security/restricted amd64 Packages [95.1 kB]
Get:40 http://old-releases.ubuntu.com/ubuntu impish-security/restricted Translation-en [12.4 kB]
Get:41 http://old-releases.ubuntu.com/ubuntu impish-security/restricted amd64 c-n-f Metadata [532 B]
Get:42 http://old-releases.ubuntu.com/ubuntu impish-security/universe amd64 Packages [207 kB]
Get:43 http://old-releases.ubuntu.com/ubuntu impish-security/universe Translation-en [61.1 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
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!
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
how do i get the release file back,please help