The Problem

when I did sudo apt update && sudo apt upgrade -y I noticed that it was trying to connect to the ubuntu mirror over IPv6 (and failing)

My ISP hasn’t enabled IPv6 for me, so I can’t connect over IPv6. and I don’t have any IPv6 DNS servers. But still apt was trying to connect over IPv6… weird…

APT trying to connect over IPv6

The Fix

You can create a file in the /etc/apt/apt.conf.d directory to force apt to use IPv4

 echo 'Acquire::ForceIPv4 "true";' | sudo tee /etc/apt/apt.conf.d/99force-ipv4

I tried updating after this and can confirm that it works :D

apt fix