Edit
Open /etc/sysctl.conf
and add following lines.
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
run
sudo sysctl -p
Check
cat /proc/sys/net/ipv6/conf/all/disable_ipv6
- 1 - disabled
- 0 - enabled