Report this

What is the reason for this report?

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

Posted on February 24, 2016

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!



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!

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.

when i did in server ubuntu 16.00 was not able to update, why ?

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.

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

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.