0

For some reason I cannot install new applications and also not run apt-get update on ubuntu 14 server

When i run apt-get update i get the following:

apt-get update
Err http://gb.archive.ubuntu.com trusty InRelease

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

Err http://gb.archive.ubuntu.com trusty-updates InRelease

Err http://gb.archive.ubuntu.com trusty-backports InRelease

Err http://security.ubuntu.com trusty-security Release.gpg
  Could not resolve 'security.ubuntu.com'
Err http://gb.archive.ubuntu.com trusty Release.gpg
  Could not resolve 'gb.archive.ubuntu.com'
Err http://gb.archive.ubuntu.com trusty-updates Release.gpg
  Could not resolve 'gb.archive.ubuntu.com'
Err http://gb.archive.ubuntu.com trusty-backports Release.gpg
  Could not resolve 'gb.archive.ubuntu.com'
Reading package lists... Done
W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/trusty/InRelease

W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/trusty-updates/InRelease

W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/trusty-backports/InRelease

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

W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/trusty/Release.gpg  Could not resolve 'gb.archive.ubuntu.com'

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/trusty-security/Release.gpg  Could not resolve 'security.ubuntu.com'

W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/trusty-updates/Release.gpg  Could not resolve 'gb.archive.ubuntu.com'

W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/trusty-backports/Release.gpg  Could not resolve 'gb.archive.ubuntu.com'

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

I have a net connection as pinging various IPs works.. is there a safe way of resetting the factory default (although i have not modified the list) the /etc/apt/source list?

Thanks, john

John
  • 225

2 Answers2

3
  1. Ensure the nameserver IPs in /etc/resolv.conf file are pinging from your machine.
  2. If not try using a reliable name server like the Google's 8.8.8.8 and 8.8.4.4.
  3. Try putting the nameserver IP found in resolv.conf in your /etc/network/interfaces file as nameserver <IP of the DNS server> and restart the network by running /etc/init.d/networking restart and see if that works.
  4. If none of them works, try changing the order in /etc/nsswitch.conf, line host: put the dns first. hosts: files dns mdns4_minimal [NOTFOUND=return] mdns4

You can find the discussion on a similar question here.

Deepak D
  • 166
-1

If you have a firewall such as UFW, you can either add an exception, or temporarily disable the firewall. Sometimes the firewall will block outgoing requests, so no matter what you change about the nameserver config, it won't work unless outgoing traffic is allowed by the firewall or the firewall is disabled.