Thursday, June 9, 2016

apt-get update fails in Ubuntu Server

Normal Ubuntu releases are supported for 9 months, whereas LTS (Long Term Support) releases are supported for 5 years.  Once support is up for the version of Ubuntu you are using the repository is moved to another server and will no longer be available on the standard 

apt-get update error - W: Failed to fetch mirrors / Some index files failed to download. They have been ignored, or old ones used instead

#apt-get update
*
W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/natty-security/multiverse/i18n/Translation-en_US  Connection failed [IP: 91.189.92.169 80]
W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/natty-security/multiverse/i18n/Translation-en  Connection failed [IP: 91.189.92.171 80]
W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/natty-security/restricted/i18n/Translation-en_US  Connection failed [IP: 91.189.88.40 80]
W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/natty-security/restricted/i18n/Translation-en  Connection failed [IP: 91.189.88.46 80]
W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/natty-security/universe/i18n/Translation-en_US  Connection failed [IP: 91.189.92.170 80]
W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/natty-security/universe/i18n/Translation-en  Connection failed [IP: 91.189.88.31 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.

First check your /etc/resolv.conf file
This might be a dns issue. Preferably I like to use public dns, so I would check what's in the file
nameserver 8.8.8.8
nameserver 4.2.2.2

If DNS Servers are missing then edit in the Interfaces file.
#sudo nano /etc/network/interfaces

Refresh your network settigs:
#sudo ifdown eth0 && sudo ifup eth0

If Still problem is there then you need to change the mirrors for Updates
free.nchc.org.tw mirrors site is always available & fast and upgraded mirrors sites, one of my favorites

sed is the command which will replace the in.archive.ubuntu.com into free.nchc.org.tw from given sources file.
but you need to take backup of sources.list file.
#sudo cp /etc/apt/sources.list  /etc/apt/sources.list.old

#sudo sed -i 's/in.archive.ubuntu.com/free.nchc.org.tw/g'  /etc/apt/sources.list
 
To Clean the Repository
#sudo apt-get clean
 
Now it should work like a charm
#sudo apt-get update


1 comment:

  1. bons casino online | Free Spins | Best BONUS Casino
    Who are bons vua nhà cái casino online? Online ボンズ カジノ bonus casinos are an extremely popular choice among 카지노사이트 players who are looking to bet on their favorite games

    ReplyDelete