11

This question already has an answer here:

When I do sudo apt update I keep getting stuck in the line below:

0% [Connecting to security.ubuntu.com (2001:67c:1360:8001::21)] 

Is there any problem with ipv6 resolution in Ubuntu? Is there a way to force ipv4 in case this is the problem ? (maybe my router is not so smart, I don't know).

Ping output:

ping6 2001:67c:1360:8001::21
PING 2001:67c:1360:8001::21(2001:67c:1360:8001::21) 56 data bytes
^C
--- 2001:67c:1360:8001::21 ping statistics ---
12 packets transmitted, 0 received, 100% packet loss, time 11000ms

Traceroute output:

 traceroute6  2001:67c:1360:8001::21traceroute to 2001:67c:1360:8001::21
 , 30 hops max, 24 byte packets
 1  * * *
 2  * * *
 3  * * *
 4  * * *
 5  * * *
 6  * * *
 7  * * *

marked as duplicate by Byte Commander, user364819, David Foerster, Zanna, Pilot6 Jun 9 '17 at 9:30

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Whoa! Thanks! I didn't knew there was a Best Server option! Trying it here... – eri0o Dec 21 '16 at 1:06
  • @ScottStensland , it worked! Can you write an answer? – eri0o Dec 21 '16 at 1:24
8

From time to time ... like after traveling to a new location ... its good to update your locally fastest ubuntu repo server by running this probe

System Settings -> 
Software & Updates -> 
Download from -> 
Other -> 
Select Best Server
  • 1
    Why are you delete the comment? – Liso Dec 21 '16 at 1:42
  • 2
    How do you do this from the CLI? – Fake Name Jun 28 '17 at 5:59
18

Adding -o Acquire::ForceIPv4=true after your apt-get command will force IPv4 connectivity.

For a permanent fix, create a file called /etc/apt/apt.conf.d/99force-ipv4 and add the following line to it:

Acquire::ForceIPv4 "true"; 

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