If for any reason you want to disable ipv6 and don’t want to do it with the sysctl directive, another easy route is to append ‘ipv6.disable=1’ to the kernel boot parameters.
The grub Way
Open /etc/default/grub and edit the line that starts with GRUB_CMDLINE_LINUX_DEFAULT.
Add the entry ‘ipv6.disable=1’ to the arguments that are already there.
Save and run
sudo update-grub
The Lilo Way
Open /etc/lilo.conf find and edit the line that starts with append=.
Add the entry ‘ipv6.disable=1’ to the arguments that are already there.
Save and run
sudo lilo