The tool 'apt-get' has no "happy eyeball" (RFC 6555) features. That means that a bad IPv6 connection can cause long delays: a plain "sudo apt-get update" took 18 minutes on my already uptodate machine. :-(
Cause: apt-get tries each server and it takes a long time to time-out:
0% [Connecting to security.ubuntu.com (2001:67c:1562::13)]
0% [Connecting to security.ubuntu.com (2001:67c:1360:8c01::18)]
0% [Connecting to security.ubuntu.com (2001:67c:1562::15)]
As long as apt-get has no happy eyeball built in, there is a ugly work around:
Create a file /etc/apt/apt.conf.d/99timeout with these contents
Now the time-out on non-reachable (IPv6) servers only takes two seconds.