If you're not utilizing IPv6 on your network, there's typically no harm in leaving it enabled on your Linux PC. However, if you're using an IPv4 VPN, leaving IPv6 enabled may result in network traffic leaks while the VPN is active. This comprehensive guide demonstrates how to disable IPv6 in Ubuntu, Debian, and Linux Mint. If you wish to permanently deactivate IPv6, you'll need to make some quick adjustments to your boot loader configuration.
Step-by-Step Instructions

Press Ctrl+Alt+t on your keyboard. This will launch a terminal window.

Type sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1 and then press ↵ Enter.

Execute sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1 and then hit ↵
Enter.

Type sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1 and then press ↵ Enter.

Type cat /proc/sys/net/ipv6/conf/all/disable_ipv6 and then hit ↵ Enter. Make sure the result shows '1' before proceeding to the next step.
- If it displays '0,' execute sudo sysctl -p and press Enter. You should see three entries ending with '1,' indicating you can move forward.

Open sudo vi /etc/default/grub and press ↵ Enter. The following steps will ensure IPv6 remains disabled even after a system reboot. You'll be prompted to input your password.
- If you prefer using a text editor other than Vi, like Nano or Pico, feel free to do so.
- Enter your password when asked.

Modify the value of GRUB_CMDLINE_LINUX_DEFAULT. The current value may be empty. Alter it to resemble the following:
- GRUB_CMDLINE_LINUX_DEFAULT='ipv6.disable=1'
- If there were other parameters like 'quiet splash,' simply separate them from the new one with a space (e.g., GRUB_CMDLINE_LINUX_DEFAULT='quiet spash ipv6.disable=1').

Modify the GRUB_CMDLINE_LINUX value. Adjust this line to read as follows:
- GRUB_CMDLINE_LINUX='ipv6.disable=1'

Save and close the configuration file. If you're using Vi, hit the esc key, input wq!, and then press Enter.

Enter sudo update-grub at the command prompt and press ↵ Enter. This action guarantees that IPv6 will stay disabled upon rebooting your PC.