Open /etc/gai.conf
Uncomment the following line:
#
# For sites which prefer IPv4 connections change the last line to
# precedence ::ffff:0:0/96 100
This will allow you to still use IPv6 but sets IPv4 as the precedence so that apt-get won’t get stuck.