Are you using ipv6? If so, you might need to force apt to use ipv4, e.g. sudo apt-get -o Acquire::ForceIPv4=true update
. The -o Acquire::ForceIPv4=true
config will force ipv4.
You can configure apt to do this without the need to add the option each time. Simply place that option in a config file: echo 'Acquire::ForceIPv4 "true";' | sudo tee /etc/apt/apt.conf.d/99force-ipv4
. That will create a conf file to change Apt settings.
I think I used https://www.ostechnix.com/how-to-force-apt-package-manager-to-use-ipv4-in-ubuntu-16-04/ as inspiration.
Following https://www.howtogeek.com/167190/how-and-why-to-assign-the-.local-domain-to-your-raspberry-pi/.
Essentially, sudo apt-get install avahi-daemon
. Make sure the Pi has an mDNS broadcaster installed.