Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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 4.2.2.2, 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

share|improve this question

2 Answers 2

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

https://help.ubuntu.com/community/Repositories/Ubuntu#Adding_Repositories_in_Ubuntu

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

https://help.ubuntu.com/community/Repositories/Ubuntu#Download_Server

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"]

share|improve this answer

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 8.8.8.8' 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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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