Taken from https://forums.raspberrypi.com/viewtopic.php?t=216026
On /etc/network/interfaces
add these lines
iface lo inet6 manual
iface eth0 inet6 manual
iface wlan0 inet6 manual
on /etc/sysctl.conf
add/change
net.ipv6.conf.all.disable_ipv6=1
on /etc/gai.conf
add or change
precedence ::ffff:0:0/96 100