Nội dung
In today’s article, AZDIGI will guide you on solving the problem: The repository no longer has a Release file on Ubuntu.
I. Introduction and cause
In the process of using the Ubuntu OS, surely each of us will manually use the apt-get update
command to update the Ubuntu operating system.
But suddenly, you use this command and get the following error:
root@labbao:~# apt-get update Ign:1 http://us.archive.ubuntu.com/ubuntu cosmic InRelease Ign:2 http://security.ubuntu.com/ubuntu cosmic-security InRelease Ign:3 http://us.archive.ubuntu.com/ubuntu cosmic-updates InRelease Err:4 http://security.ubuntu.com/ubuntu cosmic-security Release 404 Not Found [IP: 91.189.91.39 80] Ign:5 http://us.archive.ubuntu.com/ubuntu cosmic-backports InRelease Err:6 http://us.archive.ubuntu.com/ubuntu cosmic Release 404 Not Found [IP: 91.189.91.39 80] Err:7 http://us.archive.ubuntu.com/ubuntu cosmic-updates Release 404 Not Found [IP: 91.189.91.39 80] Err:8 http://us.archive.ubuntu.com/ubuntu cosmic-backports Release 404 Not Found [IP: 91.189.91.39 80] Reading package lists... Done E: The repository 'http://security.ubuntu.com/ubuntu cosmic-security Release' no longer has 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://us.archive.ubuntu.com/ubuntu cosmic Release' no longer has 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://us.archive.ubuntu.com/ubuntu cosmic-updates Release' no longer has 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://us.archive.ubuntu.com/ubuntu cosmic-backports Release' no longer has 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.
Here is the image to help you visualize the error.
The cause of this error is that older releases of Ubuntu are moved to a new host, so you need to update your repo list according to the new server for everything to work again. And I used to get this error on Ubuntu 18.10.
In addition, this tutorial also helps to fix the following error when you install new software on Ubuntu:
Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
II. Fix the “The repository no longer has a Release file” error on Ubuntu
To fix the “The repository no longer has a Release file” error on Ubuntu, we need to follow these 2 steps.
Step 1: SSH into your Ubuntu server
To fix this error, we first need to SSH or access your VPS/server with root privileges. If you don’t know how to SSH into your VPS/Server, you can refer to the following tutorial:
After successfully SSH, we continue with step 2 to perform commands to fix this error.
Step 2: Commands to fix the error: The repository no longer has a Release file on Ubuntu
We will use the following 3 commands to fix this error:
# cp /etc/apt/sources.list /etc/apt/sources.list.bak # sudo sed -i -re 's/([a-z]{2}.)?archive.ubuntu.com|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list # sudo apt-get update && sudo apt-get dist-upgrade
Explanation of commands:
- Command 1: Back up the current
sources.list
file on the server. - Command 2: Replace the links with the new repository address.
- Command 3: Rerun update after executing the above two commands.
Below is my process:
Once command 3 has run successfully, you can select Y to continue the update process for your Ubuntu server. Or select N to cancel the update process.
And once command 3 has run normally, your “The repository no longer has a Release file” problem has also been solved.
III. Summary
At present, Ubuntu 18 is also an outdated version of Ubuntu, so if you can, consider gradually switching to Ubuntu 20, it will be much better and will also avoid minor errors like this.
Hopefully, this article will be helpful to you. Wishing you success.
See more useful articles about Ubuntu at the following link:
If you need assistance, you can contact support in the ways below:
- Hotline 247: 028 888 24768 (Ext 0)
- Ticket/Email: You use the email to register for the service and send it directly to support@azdigi.com.