Question

apt-get update error - W: Failed to fetch mirrors / Some index files failed to download. They have been ignored, or old ones used instead

Hello there,

When I log in to my droplet and execute the following command:

apt-get update

I get the following:

Err http://repo.mysql.com trusty InRelease

Err http://ppa.launchpad.net trusty InRelease

Err http://repo.mysql.com trusty Release.gpg
  Could not resolve 'repo.mysql.com'
Err http://ppa.launchpad.net trusty Release.gpg
  Could not resolve 'ppa.launchpad.net'
Err http://security.ubuntu.com trusty-security InRelease

Err http://security.ubuntu.com trusty-security Release.gpg
  Could not resolve 'security.ubuntu.com'
Err http://mirrors.digitalocean.com trusty InRelease

Err http://mirrors.digitalocean.com trusty-updates InRelease

Err http://mirrors.digitalocean.com trusty Release.gpg
  Could not resolve 'mirrors.digitalocean.com'
Err http://mirrors.digitalocean.com trusty-updates Release.gpg
  Could not resolve 'mirrors.digitalocean.com'
Reading package lists... Done
W: Failed to fetch http://mirrors.digitalocean.com/ubuntu/dists/trusty/InRelease

W: Failed to fetch http://mirrors.digitalocean.com/ubuntu/dists/trusty-updates/InRelease

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/trusty-security/InRelease

W: Failed to fetch http://repo.mysql.com/apt/ubuntu/dists/trusty/InRelease

W: Failed to fetch http://ppa.launchpad.net/ondrej/php5-5.6/ubuntu/dists/trusty/InRelease

W: Failed to fetch http://repo.mysql.com/apt/ubuntu/dists/trusty/Release.gpg  Could not resolve 'repo.mysql.com'

W: Failed to fetch http://ppa.launchpad.net/ondrej/php5-5.6/ubuntu/dists/trusty/Release.gpg  Could not resolve 'ppa.launchpad.net'

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/trusty-security/Release.gpg  Could not resolve 'security.ubuntu.com'

W: Failed to fetch http://mirrors.digitalocean.com/ubuntu/dists/trusty/Release.gpg  Could not resolve 'mirrors.digitalocean.com'

W: Failed to fetch http://mirrors.digitalocean.com/ubuntu/dists/trusty-updates/Release.gpg  Could not resolve 'mirrors.digitalocean.com'

W: Some index files failed to download. They have been ignored, or old ones used instead.

How can I fix this?

I don’t know if it is related but I will mention it anyway. Yesterday I did a few changes on my machine. I followed the tutorials from here:

https://www.digitalocean.com/community/tutorials/how-to-set-up-a-firewall-using-iptables-on-ubuntu-14-04

and

https://www.digitalocean.com/community/tutorials/how-to-implement-a-basic-firewall-template-with-iptables-on-ubuntu-14-04

Please help!

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

can you check your /etc/resolv.conf file? This might be a dns issue. Preferably I like to use public dns, so I would check whats in the file and if they are not nameserver 8.8.8.8 nameserver 4.2.2.2

I’d comment them out and add the above

It looks like you broke DNS connectivity with your droplet, as it appears to be unable to resolve domain names. I would roll back the changes you made to your firewall. You would then review your firewall rules to make sure outgoing traffic is allowed back in.

how to fix this root@RMXE:~# apt-get update Ign http://old.kali.org moto/non-free Translation-en_US Ign http://old.kali.org moto/non-free Translation-en Fetched 37.2 MB in 1min 26s (433 kB/s) W: Failed to fetch http://packagecloud.io/AtomEditor/atom/any/dists/any/main/binary-amd64/Packages 301 Moved Permanently [IP: 50.97.198.58 80]

E: Some index files failed to download. They have been ignored, or old ones used instead.