How to disable IPv6 in Linux?

Disabling IPv6 can cause problems. If your Internet connection and router have already migrated to IPv6, you’ll lose the ability to use it properly. IPv6 may also be required for some home networking functions – for example, the easy-to-use Homegroup home networking feature introduced in Windows 7, Linux etc. requires IPv6 enabled on the computers on your home network to use it.