Ubuntu – Why does apt-get fail to resolve the mirror?

aptserver

Possible Duplicate:
apt-get update fails to fetch files, “Temporary failure resolving …” error

I know this has been covered before, but I can't seem to resolve my issue. Here is my output.

jake@KUBIE-SERVER:~$ sudo apt-get update
Err http://us.archive.ubuntu.com precise InRelease

Err http://us.archive.ubuntu.com precise-updates InRelease

Err http://us.archive.ubuntu.com precise-backports InRelease

Err http://security.ubuntu.com precise-security InRelease

Err http://archive.canonical.com precise InRelease

Err http://ppa.launchpad.net precise InRelease

Err http://archive.canonical.com precise Release.gpg
  Temporary failure resolving 'archive.canonical.com'
Err http://ppa.launchpad.net precise Release.gpg
  Temporary failure resolving 'ppa.launchpad.net'
Err http://security.ubuntu.com precise-security Release.gpg
  Temporary failure resolving 'security.ubuntu.com'
Err http://us.archive.ubuntu.com precise Release.gpg
  Temporary failure resolving 'us.archive.ubuntu.com'
Err http://us.archive.ubuntu.com precise-updates Release.gpg
  Temporary failure resolving 'us.archive.ubuntu.com'
Err http://us.archive.ubuntu.com precise-backports Release.gpg
  Temporary failure resolving 'us.archive.ubuntu.com'
Reading package lists... Done
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/InRelease

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise-        updates/InRelease

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise-  backports/InRelease

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-security/InRelease

W: Failed to fetch http://archive.canonical.com/ubuntu/dists/precise/InRelease

W: Failed to fetch     http://ppa.launchpad.net/webupd8team/java/ubuntu/dists/precise/InRelease

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/Release.gpg    Temporary failure resolving 'us.archive.ubuntu.com'

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise- updates/Release.gpg  Temporary failure resolving 'us.archive.ubuntu.com'

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise-  backports/Release.gpg  Temporary failure resolving 'us.archive.ubuntu.com'

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-  security/Release.gpg  Temporary failure resolving 'security.ubuntu.com'

W: Failed to fetch http://archive.canonical.com/ubuntu/dists/precise/Release.gpg    Temporary failure resolving 'archive.canonical.com'

W: Failed to fetch   http://ppa.launchpad.net/webupd8team/java/ubuntu/dists/precise/Release.gpg  Temporary  failure resolving 'ppa.launchpad.net'

W: Some index files failed to download. They have been ignored, or old ones used  instead.

Any help is greatly appreciated.

Best Answer

I had the same error. I originally thought it was an error in /etc/apt/sources.list but after doing a ping of not only security.ubuntu.com but google.com as well, I found that my server was connecting to the network but not reaching outside the network.

I edited /etc/network/interfaces and set eth0 to DHCP rather than static. I then had my router take care of giving the server a static IP. Reboot the server and all working fine.

You can find out more about IP configurations here.