10

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  * * *
3
  • Whoa! Thanks! I didn't knew there was a Best Server option! Trying it here...
    – eri0o
    Dec 21, 2016 at 1:06
  • @ScottStensland , it worked! Can you write an answer?
    – eri0o
    Dec 21, 2016 at 1:24
  • You can go to Network setting and ignore IPv6 with network that you connected. Feb 2, 2019 at 11:46

2 Answers 2

20

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"; 
9

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
2
  • 1
    Why are you delete the comment?
    – Liso
    Dec 21, 2016 at 1:42
  • 2
    How do you do this from the CLI?
    – Fake Name
    Jun 28, 2017 at 5:59

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