2

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
4

Your repository sources are not following the correct 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 or version of your Ubuntu distribution.

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

You do not appear to have the correct format in your /etc/apt/sources.list file.


Important notice:

Release and InRelease are old... old Debian style repositories and no longer used in official Ubuntu repository formats since Ubuntu 14.04 but you still have them in your Ubuntu 18.04 sources list!


To fix this, please run 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

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.


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

sudo mkdir ~/old_sources_list_d

Then, run the following command in the terminal:

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 /etc/apt/sources.list.d/*

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

sudo apt update
  • 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 at 5:54
  • @singrium Kindly see the updated answer. – Raffa Aug 31 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 at 14:34
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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.