Friday, September 25, 2015

Unable to Update & Install via apt-get command

When trying to update or install software on Ubuntu server, below message if display as unable to fetch the source. There are few possibility where the mirror server is unreachable, outdated, or the host unable to be resolve. In my case is the host name is unable to resolve.


.......
Err http://extras.ubuntu.com precise Release.gpg                        
  Unable to connect to extras.ubuntu.com:http:
Err http://security.ubuntu.com precise-security InRelease

Err http://security.ubuntu.com precise-security Release.gpg
  Unable to connect to security.ubuntu.com:http: [IP: 91.189.92.190 80]
Reading package lists... Done
W: Failed to fetch http://ph.archive.ubuntu.com/ubuntu/dists/precise/InRelease  

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

W: Failed to fetch http://ph.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://extras.ubuntu.com/ubuntu/dists/precise/InRelease  
......

Once you think of host name unable to resolve, then the DNS is play important roles in this case. So here we go to configure the DNS.

sudo nano /etc/resolvconf/resolv.conf.d

So we going to use the Google DNS, key in the parameters as below.
nameserver 8.8.8.8
nameserver 8.8.4.4

Save and exit the file then try to update the Ubuntu server again.

sudoapt-get update



No comments:

Post a Comment