Ubuntu apt-get unable to fetch packages [closed]
Solution 1:
Ran into a similar issue.
This is linked to using a non LTS version of Ubuntu called an "End of life version". As those have discontinued support. You can check if your Ubuntu is at the end of life version on this link.
The simplest solution is to do the following two steps:
- Backup your sources list
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
-
Open the sources file
/etc/apt/sources.list
and rename all the instances of us.archive or archive inhttp://us.archive.ubuntu.com/ubuntu/
to
http://old-releases.ubuntu.com/ubuntu/
Also do the same for the http://security.ubuntu.com/ubuntu/dists/saucy-security/universe/binary-i386/Packages
Run
sudo apt-get update
after doing the above.
That should fix the issue.
Warning: Please update your ubuntu to an LTS version as soon as possible otherwise you won't be getting the latest security patches. This is definitely not a solution that you would deploy on production machines.
Solution 2:
I tried using :
sudo do-release-upgrade
and then use :
sudo apt-get update
after that you will be able to install any packages.
If this did not worked for you try to change the network conf in apt.conf
Solution 3:
Just for the sake of any Googlers, if you're getting this error while building a Docker image, preface the failing RUN command with
apt-get update &&
This happens when Docker uses a cached image. Why the cached image wouldn't have the latest repo information the second time around is totally beyond me, but prefacing every single apt-get with an update does solve the problem.