Apt-Get Update: failure to fetch; can't connect to any sources

Yes, the name server update does work and if it does work then you've probably updated your IP settings to be static and your server can no longer resolve URLs.

Try the above and if it works, reboot. If it fails after rebooting, then do this:

Edit the template file for the resolv.conf. Ubuntu server rebuilds this every boot.

sudo vi /etc/resolvconf/resolv.conf.d/tail

#add just these two lines >>
nameserver 8.8.8.8
nameserver 8.8.4.4  

Then save the file and restart the service:

sudo /etc/init.d/resolvconf restart

8.8.8.8 and 8.8.4.4 are just Google's Name Servers. You should be able to add in your own ISP's if you want. If you don't like vi, use nano or vim.

I figured it out reading this article. So credit to them for the tip.


I just found the answer here. Evidently apt can't handle very many software sources, so I was able to solve my problem by deselecting all except the one I needed to access. This would be a real pain to do frequently, but it's better than nothing. From the site:

From the "Other Software" tab, disable all PPA repositories, leaving only the official Ubuntu repositories active. Enabling too many PPA repositories (which are non-official) can cause your package manager to become unstable.


Add the line nameserver 8.8.8.8 to your /etc/resolv.conf.

This sets alternate DNS servers (the public DNS servers run by Google), in case it's a DNS problem. It's similar, though not identical, to this other answer (which was posted later, and gives a different method for essentially the same reconfiguration).