Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save frankdarnese/4309b30132300571a30f5884dde3ddcd to your computer and use it in GitHub Desktop.
Save frankdarnese/4309b30132300571a30f5884dde3ddcd to your computer and use it in GitHub Desktop.
security.ubuntu.com timeout on apt-get update

security.ubuntu.com timeout on apt-get update

Issue

When running the apt-get update command, the process 'hangs' when checking security.ubuntu.com endpoints. This is apparantely due to an issue some sites face when trying to connect over IPv6 and whilst it is assumed that this will be fixed at some point in the future (sooner rather than later judging by the transition to IPv6 by most), the fix below resolves this issue, allowing the update process to complete successfully.

Fix

Edit /etc/gai.conf and uncomment the following line: precedence ::ffff:0:0/96 100. This is found directly under this comment: # For sites which prefer IPv4 connections change the last line to

Re-run apt-get update after saving the gai.conf file and you'll see the process complete successfully. All we've done is to all IPv4 connections for sites which prefer this connection protocol for now and seeing as the public web is still running across IPv4, this is OK to do for now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment