apt-get stuck connecting to security.ubuntu.com

ubuntu_logo_81x81If you are using IPv6, you might find a hung

$ sudo apt-get update

when it tries to connect to security.ubuntu.com servers.

At the moment there are problems connecting to some  of the servers over IPv6. Till it gets fixed, the workaround is to give preference to IPv4 over IPv6.

Edit /etc/gai.conf and change the following line:

#
#    For sites which prefer IPv4 connections change the last line to
#
#precedence ::ffff:0:0/96  100

to

precedence ::ffff:0:0/96  100

Here’s the relevant bug to check the status.

Comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s