My problem is that when I do an apt-get update is trying to resolve ipv6 ips, and its failing to update/install/etc.
How to disable ipv6 at apt-get?
The ping to www.google.com.ar, resolves to an ipv4.
And this is debian runnung in an OpenVZ container.
This is in a production server and online ONE openvz cluster has this problem! Thats why I want to find other solution than disable ipv6.
Thanks!
Unix.SE has two good answers for this:
If you only want to disable IPv4 for APT, and you run Debian wheezy or *buntu saucy, or newer, that is, APT 0.9.7.9~exp1 or newer, you can use the
Acquire::ForceIPv4
option, either on the command line (-o Acquire::ForceIPv4=true
) or inapt.conf
(Acquire::ForceIPv4 "true";
).If you want to prefer IPv4 over IPv6 systemwide you can uncomment (or append) the line
precedence ::ffff:0:0/96 100
in/etc/gai.conf
. I think that this is what applies to your usecase.I assume that you've got ipv6 enabled but a broken ipv6 setup, so, probably what you want to do is blacklist the ipv6 module, and restart.