20

Few days ago, I installed Ubuntu on my PC, everything works fine.
It happened that I traveled to another country and I am still there. So whenever I run the update or try to install anything from Ubuntu Software, nothing works, although my internet works fine and I can access to internet using my PC (I am using it now to write these lines).
I tried to change the server to one of the country's servers where I am now, but it didn't work. So I changed to the Ubuntu main server, it also didn't work.
I restarted my PC, run sudo apt autoclean and sudo apt clean, nothing changed.
I still get these errors whenever I run the update process:

sudo apt update
Ign:1 http://archive.canonical.com/ubuntu bionic InRelease
Err:2 http://archive.canonical.com/ubuntu bionic Release
  404  Not Found [IP: 91.189.92.191 80]
Ign:3 http://archive.ubuntu.com/ubuntu bionic InRelease
Ign:4 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Ign:5 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Ign:6 http://archive.ubuntu.com/ubuntu bionic-security InRelease
Err:7 http://archive.ubuntu.com/ubuntu bionic Release
  404  Not Found [IP: 91.189.88.174 80]
Err:8 http://archive.ubuntu.com/ubuntu bionic-updates Release
  404  Not Found [IP: 91.189.88.174 80]
Err:9 http://archive.ubuntu.com/ubuntu bionic-backports Release
  404  Not Found [IP: 91.189.88.174 80]
Err:10 http://archive.ubuntu.com/ubuntu bionic-security Release
  404  Not Found [IP: 91.189.88.174 80]
Reading package lists... Done
E: The repository 'http://archive.canonical.com/ubuntu bionic 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://archive.ubuntu.com/ubuntu bionic Release' does not have 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://archive.ubuntu.com/ubuntu bionic-updates Release' does not have 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://archive.ubuntu.com/ubuntu bionic-backports Release' does not have 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://archive.ubuntu.com/ubuntu bionic-security Release' does not have 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.

Anyone knows how to fix this?

EDIT:
The problem is not that I don't have the right links in /etc/apt/sources.list. My problem is that when I run the update, the links that appear in the terminal are not similar to the ones I have in /etc/apt/sources.list Also when I updated /etc/apt/sources.list as Raffa said, I still get similar errors.

sudo apt update 
Ign:1 http://archive.ubuntu.com/ubuntu bionic InRelease
Ign:2 http://security.ubuntu.com/ubuntu bionic-security InRelease
Ign:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Err:4 http://security.ubuntu.com/ubuntu bionic-security Release
  404  Not Found [IP: 91.189.91.14 80]
Err:5 http://archive.ubuntu.com/ubuntu bionic Release
  404  Not Found [IP: 91.189.88.31 80]
Err:6 http://archive.ubuntu.com/ubuntu bionic-updates Release
  404  Not Found [IP: 91.189.88.31 80]
Reading package lists... Done
E: The repository 'http://security.ubuntu.com/ubuntu bionic-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://archive.ubuntu.com/ubuntu bionic Release' does not have 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://archive.ubuntu.com/ubuntu bionic-updates Release' does not have 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.

Although /etc/apt/sources.list contains the links mentioned by Raffa

cat /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu bionic main universe multiverse restricted
deb http://security.ubuntu.com/ubuntu/ bionic-security main multiverse universe restricted
deb http://archive.ubuntu.com/ubuntu bionic-updates main multiverse universe restricted

5 Answers 5

23

For some reason APT can not find the Release file in the specified repositories list.

To fix this, I would suggest the following:

  • Check if your connection to the Internet is behind a firewall, limited in any way or behind a proxy and configure your system and connection accordingly or change to a different connection if available.

  • Check if there is an APT proxy configuration file by running the following command:

ls /etc/apt/apt.conf.d/*proxy*

If the command returns back any results, move these files out of the /etc/apt/apt.conf.d/ directory or delete them.

  • Revert your repositories list to the original Ubuntu Bionic Beaver list by running the following command in the terminal:
sudo nano /etc/apt/sources.list

A file editor will be opened. Delete all the lines in it and then copy and paste the following in the file editor:

deb http://archive.ubuntu.com/ubuntu bionic main universe multiverse restricted
deb http://security.ubuntu.com/ubuntu/ bionic-security main multiverse universe restricted
deb http://archive.ubuntu.com/ubuntu bionic-updates main multiverse universe restricted

Then, save and close the file by pressing Ctrl + X then press Y then press Enter

To verify you saved the file correctly, please run the following command in the terminal:

cat /etc/apt/sources.list

The output should be exactly:

deb http://archive.ubuntu.com/ubuntu bionic main universe multiverse restricted
deb http://security.ubuntu.com/ubuntu/ bionic-security main multiverse universe restricted
deb http://archive.ubuntu.com/ubuntu bionic-updates main multiverse universe restricted

Ubuntu repositories have a defined format. They should be for example something like deb http://archive.ubuntu.com/ubuntu bionic main.

Explanation:

deb: These repositories contain binaries or precompiled packages. These repositories are required for most users.

http://archive.ubuntu.com/ubuntu: The URI (Uniform Resource Identifier), in this case a location on the internet.

bionic: is the release name of your Ubuntu installation.

main & restricted ...etc: are the section names or components. There can be several section names, separated by spaces.


After that, please update your repositories list by running the following command in the terminal:

sudo apt update

You should now be able to install packages and update your system again.


Notice:

If you still get errors, please first back up /etc/apt/sources.list.d/ to your home directory by running the following command in the terminal:

mkdir ~/old_sources_list_d && sudo cp -r /etc/apt/sources.list.d/* ~/old_sources_list_d/

After that, please clear all existing PPAs and repository lists in /etc/apt/sources.list.d/ by running the following command in the terminal:

sudo rm -r /etc/apt/sources.list.d/*

Then, please update your repositories list by running the following command again in the terminal:

sudo apt update
6
  • the problem is that the links that appear when I run the update, are not the same in /etc/apt/sources.list. I will update my question with more details
    – singrium
    Aug 31, 2019 at 5:54
  • @singrium Kindly see the updated answer.
    – Raffa
    Aug 31, 2019 at 14:11
  • I did as you said then run the update but nothing worked. I changed the WiFi (connected to my phone data), everything works fine. Thank you for your help.
    – singrium
    Aug 31, 2019 at 14:34
  • Do you think it is ok to change some of the content of /etc/apt/sources.list? It seems a little bit delicate Jun 25, 2021 at 1:25
  • 1
    @Elborito It is ok as long as you follow the correct format and avoid mixing sources of different releases and avoid adding third party sources.
    – Raffa
    Jun 25, 2021 at 9:03
4

I think it is not exactly because the change of country from your connection. It is because the new connection has any proxy server or system to block or redirect Ubuntu servers ... (could be government or institution)

I have a similar problem connecting from the "sala de computo" (compute room) in my University.

I think I can use some VPN or servers configurations (DNS) to jump this ...

1
  • That's right. I remember I had to use some proxy to be able to update.
    – singrium
    Mar 2, 2020 at 15:32
1

If you are in Tunisia, you could change to the appropriate repository https://launchpad.net/ubuntu/+mirror/ubuntu.mirror.tn-archive2

but I notice it's not current and does not even have files for Bionic, much less newer distros. There is no repository in Algeria or Libya, so you might try alternatives in France, Spain, Switzerland, or the Netherlands.

1
  • Please check my question's update
    – singrium
    Aug 31, 2019 at 6:21
1

I simply commented out the server name that was causing me the issue in the /etc/apt/sources.list.

1

An easier approach for newbies without using the command line:

  • Open Software Updater
  • Settings
  • Ubuntu Software
  • Download from:
  • Other...
  • mirrors.ubuntu.com (scroll up to the first entry)
  • Choose Server
  • (Enter your password if prompted)
  • Close
  • Reload (when prompted about "software out-of-date")

Updating should work normally.

You must log in to answer this question.

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