Ubuntu updates hang
Linode Linode Staff
When I'm running
apt-get update it hangs while connecting to
How do I fix this?
tommydavidson Linode Staff
It sounds as though you are encountering an issue with Ubuntu systems in which IPv6 connections hang for a long time/timeout altogether. In most cases, just letting it sit for a while will eventually result in
apt continuing with updates, however it can take a very long time (often minutes).
To fix this, you will want to add the following to the file '/etc/apt/apt.conf.d/99force-ipv4':
You can do this using the following command:
echo 'Acquire::ForceIPv4 "true";' | sudo tee /etc/apt/apt.conf.d/99force-ipv4
This will disable using IPv6 for APT, while leaving it enabled for your system overall.