Page 1 of 1

Ubuntu: APT waits forever connecting to repo over IPv6

Posted: Thu Jul 05, 2018 4:00 pm
by ^rooker
[PROBLEM]
Suddenly, from one day to another my apt stopped working:
When updating the repository cache, it just stopped, waiting to connect to an up-and-running server - forever...

Like this:

Code: Select all

Hit:1 http://ppa.launchpad.net/kdenlive/kdenlive-stable/ubuntu xenial InRelease
Ign:3 https://mediaarea.net/repo/deb/ubuntu xenial InRelease
Hit:4 https://mediaarea.net/repo/deb/ubuntu xenial Release
Hit:6 http://ppa.launchpad.net/me-davidsansome/clementine-dev/ubuntu xenial InRelease
0% [Connecting to at.archive.ubuntu.com (2a00:1860:1:2::101)]
As the output shows, it tries to connect to "at.archive.ubuntu.com" using its IPv6 address. I must admit I don't know (yet) if my provider even supports IPv6 already, but anyways: it didn't work :(

[SOLUTION]
Quick hack/workaround is to disable IPv6 in APT.
1) Edit/create "/etc/apt/apt.conf.d/99force-ipv4"
2) Enter the following there, and save it:

Code: Select all

Acquire::ForceIPv4 "true";
Now your repository handling should be fine again:
$ apt update
Thanks to Xiao Guo-An's article about "How to Disable IPv6 on Ubuntu" (on linuxbabe.com)!