I am using Ubuntu Server 12.04 LTS, and until yesterday, everything was quite peachy. I have installed several packages (MySQL, apache2) and to my knowledge have those configured correctly. Upon configuration of phpMyAdmin, I found that I was missing the directory path /etc/phpmyadmin, which got me thinking about the install. I am new to Ubuntu, so I guess I missed the message telling me that I did not download phpMyAdmin successfully.

Anyway, trying to use apt-get yesterday/today results in "Failed to fetch..." messages, even if just to run sudo apt-get update.

Some notable details: ···no GUI, command line only (sudo apt-get gksu fails, go figure) ···can ping, so I know the internet is out there (somewhere) ···this is a dedicated computer, using Samba to share files with Windows, which does work ···attempted to edit my /sources.list file, for various American/Canadian mirror, to no effect ···ensured I have correct DNS settings in /etc/networks/interfaces

I'm not sure where along the way it happened, but I seem to have lost connections to repositories... :) Any advice (including GO BACK TO WINDOWS) is appreciated.

Edit: fixed by adding an actual nameserver to /etc/resolv.conf


2 Answers 2


The actual solution to this problem was discovered by the original poster (and did not involve editing any of APT's configuration files). resolv.conf was blank. Adding a name server to it enabled apt-get to work. As the OP said:

my /etc/resolv.conf was blank, had no nameservers what-so-ever. added 'nameserver' and presto! apt-get is my friend again!

Sources: See this revision to the question. The quote above is from this old (now deleted) comment.


Please try following the instructions here to manage repositories using the Ubuntu Software Center - it's safer than editing those files by hand:


Specifically, try the section about choosing a regional download server starting here:


From that page: Selecting "Other" provides the opportunity to select a participating server anywhere in the world. Expand any of the country listings in the left pane and highlight a server. Then select "Choose Server" and pick one from Canada.

[edited to link to the software center page rather than using the technical word "GUI"]


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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