The last time I did an apt-get update in a specific Debian Wheezy I could not connect to the repositories because apt was preferring to use the IPv6 first. So here is a simple solution to system-wide add a preference to ipv4 in DNS IP resolution:
Edit the file /etc/gai.conf and add the following line at the end of the file:
precedence ::ffff:0:0/96 100