0

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
  • 2
    Maybe the mirror is down, have you tried another server? Jan 23, 2015 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, 2015 at 9:00

2 Answers 2

2

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 0.9.7.9~exp1 (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

0

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .