Both apt-get update and upgrade hang:
sudo apt-get update
[sudo] password for xxx:
0% [Connecting to archive.ubuntu.com (2001:67c:1360:8001::17)]
I'm able to ping archive.ubuntu.com:
ping archive.ubuntu.com
PING archive.ubuntu.com (91.189.88.162) 56(84) bytes of data.
64 bytes from yukinko.canonical.com (91.189.88.162): icmp_seq=1 ttl=50 time=42.2 ms
64 bytes from yukinko.canonical.com (91.189.88.162): icmp_seq=2 ttl=50 time=42.1 ms
64 bytes from yukinko.canonical.com (91.189.88.162): icmp_seq=3 ttl=50 time=42.1 ms
^C
--- archive.ubuntu.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 42.169/42.206/42.265/0.240 ms
I checked this question, and I don't think its the same issue.
Any tips for investigating this further?
Best Answer
From your output it seems to me that it's a
IPv6
problem, so we should forceapt
to useIPv4
instead.If we search
apt.conf (5)
manual forIPv4
we will find:To enable this option we should create a file within:
the name can be anything for something relative we use
99force-ipv4
, the number is the priority of config files within this directory.Then add the below command to this file and save it:
Then try updating your source again:
Not sure of the cause of problem, however I think your university is running an internal
IPv6
network; soapt
is trying to connect withIPv6
to its mirrors, and there may be some incompatibility. I just tried forcingapt
to useIPv4
and it worked.Short instruction:
Also we can use
echo
andtee
to write this config down with one command (from here):