Ubuntu updates hang

Linode Staff

When I'm running apt-get update it hangs while connecting to security.ubuntu.com

How do I fix this?

1 Reply

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':

Acquire::ForceIPv4 "true"

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.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct