Err http://archive.canonical.com natty InRelease    
Err http://security.ubuntu.com oneiric-security InRelease               
Err http://extras.ubuntu.com natty InRelease                            
Err http://security.ubuntu.com oneiric-security Release.gpg
  Temporary failure resolving ‘security.ubuntu.com’
Err http://archive.canonical.com natty Release.gpg
  Temporary failure resolving ‘archive.canonical.com’
Err http://extras.ubuntu.com natty Release.gpg
  Temporary failure resolving ‘extras.ubuntu.com’
Err http://gb.archive.ubuntu.com oneiric InRelease
Err http://gb.archive.ubuntu.com oneiric-updates InRelease
Err http://gb.archive.ubuntu.com natty-backports InRelease
Err http://gb.archive.ubuntu.com oneiric Release.gpg
  Temporary failure resolving ‘gb.archive.ubuntu.com’
Err http://gb.archive.ubuntu.com oneiric-updates Release.gpg
  Temporary failure resolving ‘gb.archive.ubuntu.com’
Err http://gb.archive.ubuntu.com natty-backports Release.gpg
  Temporary failure resolving ‘gb.archive.ubuntu.com’

Reading package lists... Done
W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/oneiric/InRelease      
W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/oneiric-updates/InRelease  
W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/natty-backports/InRelease  
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/oneiric-security/InRelease  
W: Failed to fetch http://archive.canonical.com/ubuntu/dists/natty/InRelease  
W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/natty/InRelease  
W: Failed to fetch http://archive.canonical.com/ubuntu/dists/natty/Release.gpg  Temporary failure resolving ‘archive.canonical.com’
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/oneiric-security/Release.gpg  Temporary failure resolving ‘security.ubuntu.com’
W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/natty/Release.gpg  Temporary failure resolving ‘extras.ubuntu.com’
W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/oneiric/Release.gpg  Temporary failure resolving ‘gb.archive.ubuntu.com’
W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/oneiric-updates/Release.gpg  Temporary failure resolving ‘gb.archive.ubuntu.com’
W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/natty-backports/Release.gpg  Temporary failure resolving ‘gb.archive.ubuntu.com’
W: Some index files failed to download. They have been ignored, or old ones used instead.

This is what I'm seeing when I try to run sudo apt-get update. I did an update on my instance yesterday and am now experiencing this.

17 Answers 17



There are two parts to your question:

  • fixing temporary resolve messages
  • fixing the package management issues

Temporary resolve

It is likely that this issue is either:

  • temporary due to your Internet Service Provider not correctly forwarding internet naming (DNS) to either its or external DNS servers, or
  • due to a change in your network has similarly blocked this naming - for example, new router/modem, reconfiguring a switch with a new configuration.

Lets look at the possible DNS resolving issues.

First, temporarily add a known DNS server to your system.

echo "nameserver" | sudo tee /etc/resolv.conf > /dev/null

Then run sudo apt-get update.

If this fixes your temporary resolving messages then either wait for 24 hours to see if your ISP fixes the issue for you (or just contact your ISP) - or you can permanently add a DNS server to your system:

echo "nameserver" | sudo tee /etc/resolvconf/resolv.conf.d/base > /dev/null is Google's own DNS server.


Another example DNS server you could use is OpenDNS - for example:

echo "nameserver" | sudo tee /etc/resolvconf/resolv.conf.d/base > /dev/null

package-management issues

In addition to the temporary resolve issues - you have a few package management issues that need to be corrected - I'm assuming you have tried recently to upgrade from one Ubuntu version to the next recommended version - in your case from Natty (11.04) to Oneiric (11.10)

Open a terminal and type

sudo nano /etc/apt/sources.list

Look for lines that have your a different distribution name in the list than you were expecting - in your case - you have upgraded to oneiric but you have another release name natty

For example, look for lines that look like deb http:/archive.canonical.com/ natty backports

Add a # to the beginning of the line to comment it out - for example

#deb http:/archive.canonical.com/ natty backports

Save and re-run:

sudo apt-get update && sudo apt-get upgrade

You should not have any more release naming errors.

At the time of writing this, possible common release names include lucid, maverick, natty, oneiric, precise, quantal, raring, saucy, trusty, utopic and vivid.

  • Perfectly works :) – Maduka Jayalath Nov 11 '12 at 13:22
  • When one name pops out during the update, you might skip the DNS fiddling and go directly to the sources list. – SPRBRN Apr 24 '14 at 15:11
  • Still works perfectly with 15.04 and 15.10 – lxx Jan 7 '16 at 7:51
  • 1
    What if this doesn't work? – Matt G Jan 12 '17 at 0:46
  • It is most likely a DNS issue of docker not letting apt-get update succeed. – dashesy May 2 '18 at 17:06

You can comment the unresolved repo from the file sources.list found on dir /etc/apt/

After modifying the sources.list, clean the apt-get repo as

apt-get clean

Then update

apt-get update

The error will gone away

  • 1
    This is a permanent solution to a temporary DNS problem. If you forget to change it back, software from that repository won't be updated or available for install anymore. – Chai T. Rex Jan 27 '18 at 13:04
  • This did not work. – Trevor Hickey Aug 1 '20 at 18:52

Note that this answer was written for old versions of Ubuntu. Current versions use a local nameserver controlled by D-Bus, for which the diagnosis part of this answer applies, but not the solution. If /etc/resolv.conf contains nameserver or more generally nameserver 127.X.Y.Z, don't modify it.

“Temporary failure resolving …” means that your DNS, i.e. the translation from host names to IP addresses, is not working. Did you reconfigure something on your machine recently? If not, this may be a transient error at your ISP.

Does ping -n show lines like 64 bytes from …? (Press Ctrl+C to stop ping.)

  • If it doesn't, you specifically have an IP connectivity problem. Run traceroute -n and see where it stops: if it's in your home/office, check your networking equipment. If you can reach your ISP, complain to them.
  • If it does, you specifically have a DNS problem. Check the contents of /etc/resolv.conf; there should be a line like nameserver (possibly more than one of them). If the lines are there, there is probably a transient problem within your ISP, and you may be able to work around it by adding nameserver to that file (this declares an extra DNS server, which is provided free of charge by Google). If the first number after nameserver is 127, then there is a DNS relay on your machine (this is a good thing), and you must configure that DNS relay rather than modify /etc/resolv.conf. On modern versions of Ubuntu, there is a DNS relay by default, it's Dnsmasq, and it's controlled by D-Bus.
  • 1
    Note: ping -c3 pings only 3 times, you don't need to Ctrl+C then. You may use any number in the parameter, like -c5 , -c1 , -c100 etc. – Arda Nov 5 '14 at 20:58
  • nameserver has to be placed with the hostname's machine? – albert Mar 7 '18 at 17:47
  • @albert The /etc/resolv.conf that matters is the one on the machine you're on. But on modern systems, it just points to the local machine, and if you have DNS troubles, you must work with D-Bus and NetworkManager. – Gilles 'SO- stop being evil' Mar 8 '18 at 7:41
  • You Sir, are a genius! Just saved my day. Thanks – Akshay Agarwal Oct 23 '19 at 3:51

Sometimes, when you are behind a proxy server, it is even necessary, that you generate a apt.conf file in /etc/apt/ and fill it with the specific entries, like:

Acquire::http::proxy "http://<yourproxyserver>:<Port>";
Acquire::https::proxy "http://<yourproxyserver>:<Port>";
Acquire::ftp::proxy "http://<yourproxyserver>:<Port>";

If there is an authentification required, the config file looks like:

Acquire::http::proxy "http://<domain\user>:<password>@<yourproxyserver>:<Port>";
Acquire::https::proxy "http://<domain\user>:<password>@<yourproxyserver>:<Port>";
Acquire::ftp::proxy "http://<domain\user>:<password>@<yourproxyserver>:<Port>";

This issue can also be caused by a wrongly named interface. For example a Temporary failure resolving error message can be caused by an interface which is not named eth0 but is incorrectly named eml instead.

Another way to solve the a Temporary failure resolving error message is by choosing a different update server mirror.

  1. Open Software & Updates from the Dash and select Ubuntu Software tab -> from the dropdown menu to the right of Download from: select Other....

    Software & Updates

  2. Click the Select the Select Best Server button to select the best download server.

    Select best server

  3. A series of tests will be performed to find the best mirror for your location.

    enter image description here

  4. Click Choose Server to select the recommended server.

  • I can not login to my account due to issues I'm facing with lightdm, I need to update lightdm, can you expand your answer on how to resolve the issue? Thanks. – Shayan Jun 11 '19 at 16:24
  • How to start Ubuntu in Console mode – karel Jun 11 '19 at 16:59

This is a DNS problem. Check your /etc/resolv.conf file.

for example in my case when i had this problem & checked this file , the file was empty! but it should contains your dns-nameserver


nameserver 192.168.10.x

192.168.10.x is my gateway ip address

  • 3
    Welcome to AskUbuntu! If you wanna help, make more verbose answer. I mean, cover most possible scenarios and ways to go or post link to appropriate tutorial. – Danatela Jul 22 '13 at 8:19
  • 1
    Could you clarify what one should check in /etc/resolv.conf? – papukaija Jul 22 '13 at 9:01
  • Actually this one saved my day! I have a FritzBox and nothing was working because some unknown things happend and everything was messed up. Just had to set the nameserver for me on – CptDayDreamer Nov 28 '19 at 20:07

The accepted solution does not work for me. In the first place, only apt-get update warns me about Temporary failure resolving 'foo.com', but when I try with nslookup foo.com or ping foo.com, it works fine!

My incredibly dirty hack/fix for solving this bug, is to add the resolved domains manually to /etc/hosts with this short script:

    mapfile -t hosts < <(
        sed -n -r '/^#/d; s;deb(-src)? (http://|ftp://)?([^/ ]+).*;\3;p'\
        /etc/apt/sources.list | sort | uniq )
    # delete all hosts from /etc/hosts, e.g., from an earlier call
    sudo sed -i -r '/^[0-9]{1,3}(\.[0-9]{1,3}){3}[ \t]+('"$( printf '|%s'\
        "${hosts[@]//./\\.}" | sed 's/^|//' )"')[ \t]*$/d' /etc/hosts
    for host in ${hosts[@]}; do
        ip=$( nslookup "$host" | sed -n -r 's|Address:[ \t]*([0-9.]+).*|\1|p' |
              tail -1 )
        sudo bash -c "echo $ip $host >> /etc/hosts"

Now updating should work:

resolveAptHosts && sudo apt-get update

If anyone knows why this workaround works and how to solve this bug for real, I'll be eternally thankful. I also tried using sudo apt-get update -o Acquire::ForceIPv4=true in order to exclude IPv6 resolve problems, but that didn't help either.


I had a similar issue, I tried many suggested solutions, but my issue was gone after I rebooted my VM.


I experienced similar errors when running apt-get commands. It turns out I had the Software Update Panel open on the console.
This seemed to be blocking the command line apt-get, but I'm not certain.


I had this error. Following a tip from Linode support, I commented out all the IPv6 lines in /etc/hosts and then apt-get update started working.


For those who are using EC2, remember to check that your security group settings allow outbound connections to the websites you are updating from. You can set All traffic outbound setting and see if it works.


I got the same issue in a vmware virtual machine, host and guest both are ubuntu. I solved the issue changing the setting of the virtual machine. Instead of using NAT, I set Bridged. It worked for me


The error messages should be saying you do not have an internet connection. You can see these same error messages if during initial ubuntu install you chose to not perform updates (did not connect to wifi/ethernet) which after install finished and you reboot can leave you at endless ubuntu login animation screen (watching those moving dots) ... You will see above error messages if you now boot into Recovery and at root prompt issue apt-get update even after you enable networking from Recovery which does not allow you to connect to wifi if you avoided wifi during initial install.

Solution to this particular edge case : plug in an ethernet cable then boot into Recovery and issue apt-get update or else reinstall from scratch and assure you enable updates

core issue - if you did not connect to wifi during install so you avoided package updates you will not be given a wifi login prompt during Recovery boot - this should get fixed ... also above error messages should just say you do not have an internet connection


Please check the hard-disk memory. My memory was almost full and so I had this error, once memory is cleared I am able to do apt-get update

  • "Hard-disk memory" is a confusing expression - do you mean free disk space? Furthermore, this question was answered almost 9 years ago. – Artur Meinild Oct 16 '20 at 16:15

Just adding another last case check. On my system for some reason when the system date was very out of sync then it resulted in the same dns resolution issues. I had a case where my date was somehow set to the year 2000. to check your date simply use the command date to make sure you are in sync.


I'm currently experiencing this very same problem and none of the above solutions worked. I noticed that APT was attempting to download some DEB packages from br.archive.ubuntu.com, which redirects to ubuntu.c3sl.ufpr.br (IPv4, but this server is currently down.

So in my case what fixed the issue was to run Synaptic (install it with sudo apt install synaptic -y and then either run it with sudo synaptic or run it directly from the Applications panel), then click on Settings => Repositories => Ubuntu Software => Download from: and select Main server, then click on the Close button and finally click on the Reload button.

In my case, the above procedure caused APT to download the updated list of DEB packages from the main repository server archive.ubuntu.com instead of from the server located in my country.


Once upon a time I've met this exact issue — it was shipped with a container. Having wasted 15 minutes I finally realised it's due to wrongly set permissions for /etc/resolv.conf:

root@4ceb6b9e64bc:/usr/lib/apt# ls -l /etc/resolv.conf
-rw-r-----+ 1 root root 19 Feb 24 06:05 /etc/resolv.conf

The fix is as trivial as chmod 644 of course.

Not the answer you're looking for? Browse other questions tagged or ask your own question.