Ubuntu Server 14.04 – Disable IPv6

If you experience problems updating or installing packages on your server with “apt-get”, it may be because the package manager is trying to connect via IPv6 and is failing. I found this info here. To disable IPv6 completely, edit the “/etc/sysctl.conf” file and place the following text in there:

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

To check and make sure your settings are in effect, in the terminal type the following and you should see the same text you entered above:

sudo sysctl -p

Then to make sure IPv6 is completely disabled, a value of “1” should be returned from the follwing command:

cat /proc/sys/net/ipv6/conf/all/disable_ipv6

Leave a Reply