Running an apt-get update or an apt-get install occasionally times out on VMs that I am building before I have setup IPv6. Instead of waiting the (seemingly) long time for it to timeout, just add:
to the end of the apt-get command to force IPv4.
And to make it permanent:
create /etc/apt/apt.conf.d/99force-ipv4 and put in it: