Disable IPv6 in Ubuntu Server

To disable ipv6, you have to open /etc/sysctl.conf using any text editor and insert the following lines at the end:

If ipv6 is still not disabled, then the problem is that sysctl.conf is still not activated.

To solve this, open a terminal(Ctrl+Alt+T) and type the command,

You will see this in the terminal:

After that, if you run:

It will report:

If you see 1, ipv6 has been successfully disabled.