Ubuntu: Problem with apt-get update: lots of “W: Failed to fetch”



Question:

I end up with this error when I run apt-get update. Any suggestion on what I can do to fix this?

This is my source list: /etc/apt/sources.list


Solution:1

Your /etc/apt/sources.list or a file in the directory /etc/apt/sources.list.d/ is messed up. Fix it using a terminal, sudo and your favorite editor.

Example:
sudo vi /etc/apt/sources.list


Solution:2

It seems your main sources.list does not have any problem.

Move anything within the /etc/apt/sources.list.d/ directory to some temporary directory and then run apt-get update again. let's us know what is the output.

mkdir ~/src-tmp  sudo mv /etc/apt/sources.list.d/* ~/src-tmp  

If you still have the problem then do a ping test:

ping archive.ubuntu.com

If the ping command did not work, try something else like dig or nslookup:

dig archive.ubuntu.com

nslookup archive.ubuntu.com

I want to make sure your dns server works okay, If you did not get any result from last 3 command, check some other url like google.com If it worked, then change your repositories to something else. for example instead of archive.ubuntu.com use something like mirrors.kernel.org.

More info: https://help.ubuntu.com/community/SourcesList


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »