I have some head crunch issues with updating my Ubuntu 12.04 server system.
When I issue the following command (as root):

apt-get update

...nothing happens and after a while apt-get gives up with loads of errors like:

W: Failed to fetch http://nl.archive.ubuntu.com/ubuntu/dists/precise-updates/restricted/i18n/Translation-en  Unable to connect to nl.archive.ubuntu.com:http:

Below a copy of the stdout. Please note that I didn't wait for the command to finish and aborted it with CTRL-C to save some time

root@webserver:/var/log/apt# apt-get update
0% [Connecting to nl.archive.ubuntu.com (]^C

This is how my sources.list looks like:

root@webserver:/var/log/apt# cat /etc/apt/sources.list
###### Ubuntu Main Repos
deb http://nl.archive.ubuntu.com/ubuntu/ precise main restricted 
deb-src http://nl.archive.ubuntu.com/ubuntu/ precise main restricted 

###### Ubuntu Update Repos
deb http://nl.archive.ubuntu.com/ubuntu/ precise-security main restricted 
deb http://nl.archive.ubuntu.com/ubuntu/ precise-updates main restricted 
deb-src http://nl.archive.ubuntu.com/ubuntu/ precise-security main restricted 
deb-src http://nl.archive.ubuntu.com/ubuntu/ precise-updates main restricted 

My /etc/apt.apt.conf is empty and no proxy is in use

root@webserver:/var/log/apt# cat /etc/apt/apt.conf
root@webserver:/var/log/apt# echo $http_proxy

root@web-octoplus01:/var/log/apt# echo $HTTP_PROXY


Using the US mirrors gives the same result. Special with the US mirrors is that every third try it suddenly works! (Only the address works, the rest results in the same errors)

root@web-octoplus01:/var/log/apt# host us.archive.ubuntu.com
us.archive.ubuntu.com has address
us.archive.ubuntu.com has address
us.archive.ubuntu.com has address
us.archive.ubuntu.com has IPv6 address 2001:67c:1562::15
us.archive.ubuntu.com has IPv6 address 2001:67c:1562::13
us.archive.ubuntu.com has IPv6 address 2001:67c:1562::14

Can it be that my server is on some inconsistent black-list at Ubuntu?
What do I not see?

  • have you tried to use another server as source for your updates? – Alvar Sep 25 '13 at 14:16

Since the IPv4 version works, you can change the priority of the type of connection to the destination node from IPv6 to IPv4 in the /etc/gai.conf file (which controls the destination address selection).

uncomment the following in the document:

precedence ::ffff:0:0/96 100

As stated in the file, this way sites that prefer IPv4 connection can be connected with IPv4 instead of IPv6.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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