I have a 12.04 LTS VPS that no longer seems to be able to apt-get anything. It connects ok for security patches, but on installing anything just hangs at 0% trying to connect to us.archive.ubuntu.com. I tried pinging us.archive.ubuntu.com and that's working. Anyone know how to solve this?

  • 2
    Maybe the mirror is down, have you tried another server? – meskobalazs Jan 23 '15 at 23:06
  • What does the output to wget --debug http://us.archive.ubuntu.com/ubuntu/project/trace/pepo.canonical.com do? – Fabby Jan 26 '15 at 9:00

Having the same issue led me to another post on forcing apt-get to acquire IPv4 connection which resolved my issue. I have quoted the answer from the other forum for convenience.

Add -o Acquire::ForceIPv4=true when running apt-get.

If you want to make the setting persistent just create /etc/apt/apt.conf.d/99force-ipv4 and put Acquire::ForceIPv4 "true";in it.

Config options Acquire::ForceIPv4 and Acquire::ForceIPv6 were added to version (see bug 611891) which is available in Ubuntu Saucy (released in october 2013) and Debian Jessie (not released yet).

Source: https://unix.stackexchange.com/questions/9940/convince-apt-get-not-to-use-ipv6-method


Updating this for future readers, I found out I could fix it by switching to prefer v4 over v6 using /etc/gai.conf.

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.