Fresh install of Ubuntu 16.04 Server tty1

26 packages can be updated
12 updates are security updates.

When I try to use sudo apt-get update, this shows up:

Err:1 http://ro.archive.ubuntu.com/ubuntu xenial InRelease
         temporary failure resolving 'ro.archive.ubuntu.com'
Err:2 http://ro.archive.ubuntu.com/ubuntu xenial-security InRelease
         temporary failure resolving 'ro.archive.ubuntu.com'
Err:3 ... xenial-updates InRelease
         temporary failure resolving 'ro.archive.ubuntu.com'
Err:4... xenial-backports InRelease
         temporary failure resolving 'ro.archive.ubuntu.com'
Failed to fetch http://ro.archive.ubuntu.com/ubuntu xenial InRelease 
temporary failure resolving 'ro.archive.ubuntu.com'
failed to fetch ....
some index failed to download. They gave been ignored,or old ones used instead.

I ran nslookup google.com:

connection timed out; no servers could be reached

Now, I tried all I could find on the internet about this issue, like adding Google DNS server in /etc/resolv.conf, then dpkg-reconfigure etc. Nothing worked.

If you need any additional info in helping me resolve this problem I am happy to provide. I'm new to Ubuntu so I don't really know much. Any additional help is welcome.

Thank you in advance!

  • 1
    Can you ping – Joakim Koed May 8 '16 at 9:03
  • 1
    There should not be a space between ubuntu and .com in the error message; if there is, it means you have a malformed /etc/apt/sources.list file. Could you please post the contents of that file? – user533208 May 10 '16 at 12:31
  • i put that space there because of the links limit, im sorry because that misleaded u, and i cant ping it says no servers could be reached – Denis May 10 '16 at 15:09
  • This helped to me: askubuntu.com/questions/59458/… – Nicholas Vasilaki Oct 25 '16 at 13:53
  • i was able to ping to google DNS but was not able to run the apt-get. I just restarted my resolvconf. It worked perfectly. – Mohan Sanagapalli Jul 14 '17 at 8:48

In my case it worked to set the Google DNS ( in /etc/resolvconf/resolv.conf.d/base

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


sudo service resolvconf restart

After this procedure I was able to resolve hostnames and

sudo apt-get update

is doing the job well!

| improve this answer | |
  • I did this too, but forgot to restart the resolvconf service. Works now. – Jabberwockey Aug 12 '17 at 20:01

I had a similar experience, wherein a complete shutdown (even removing the power cord and waiting long enough for firmware to clear, etc. Then restarting solved the same issue for me.

My only theory as to why, is that it could be some sort of caching issue on the NIC itself.

Since the NIC on this motherboard (Z87) is integrated, stuff like the ARP cache, preferred DNS servers list, etc. are likely cached in PRAM. (again, I am just speculating here.)

Since I had made a change to the DNS servers list (and I believe that's what ultimately resolved this issue) I think it took the hard start to get the new list into the cache. At any rate, the hard start solved it, whereas soft resets did not.

| improve this answer | |

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