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

February 24, 2016 12.1k views
Linux Basics Linux Commands Security Server Optimization IPv6 Ubuntu

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:




Please help!

4 Answers

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

I'd comment them out and add the above

  • I checked:

    sudo nano /etc/resolv.conf

    I have only nameserver, so I added:


    Saved, Closed. I ran the command:

    sudo apt-get update

    Same errors...

I want to thank to everyone who took part of this discussion trying to help me to find a solution.

For those who want to know it, here are the steps:
1) Go to:

sudo nano /etc/network/interfaces

2) Update the DNS line below:

. . .
iface eth0 inet6 static
        address 2604:A880:0800:0010:0000:0000:00B2:0001
        netmask 64
        gateway 2604:A880:0800:0010:0000:0000:0000:0001
        autoconf 0
        dns-nameservers ****

3) Save, close and refresh your network settigs:

sudo ifdown eth0 && sudo ifup eth0

4) Create a new firewall rule to force IPv4 when it's available. Create this new file:

sudo nano /etc/apt/apt.conf.d/99force-ipv4

5) Add this single line to the file:

Acquire::ForceIPv4 "true";

6) Save and close the file. Now apt-get update will work! ;)

  • This simply makes apt-get use IPv4 instead of IPv6. It does not change any firewall rules. If anyone has an issue similar to you, I would recommend against following those instructions because it will mask the real issue. I'm glad this workaround lets you use apt-get update, but there's a strong chance your server is still broken.

I Wish the commenter's would actually try to visit failed URL's... it looks like at least some of the DigitalOcean mirror for trusty is 404'd


no clue how long this has been true for, but it certainly is now

Have another answer? Share your knowledge.