Craig Forrester

The Pleasure of Finding Things Out

github linkedin email rss
Windows Subsystem for Linux: Disable IPv6 for Apt
March 29, 2018
One minute read


If you have IPv6 enabled on Windows 10 and attempt to use Apt in Ubuntu on the Windows Subsystem for Linux, you may get the following error:

http: ../sysdeps/posix/getaddrinfo.c:2603: getaddrinfo: 
  Assertion `IN6_IS_ADDR_V4MAPPED (sin6->sin6_addr.s6_addr32)' failed.
E: Method http has died unexpectedly!
E: Sub-process http received signal 6.

There are a number of related issues filed on GitHub for this problem, and a whole lot of varied advice on how to solve it. There are a number of reasons why you may have this problem and how to best resolve it may depend on your configuration. In some cases, you may not be able to fix the problem. There is, however, a work-around….

Disable IPv6 for Apt

There is a good write-up on how to force apt-get to use IPv4 instead, but the work-around is summed up in a one liner from a reply on Stack Exchange:

echo 'Acquire::ForceIPv4 "true";' | sudo tee /etc/apt/apt.conf.d/99force-ipv4

With this option enabled in Apt, you should be able to run apt-get operations using IPv4 instead.

Additional Reading

  • GitHub: [WSL Issues for IN6_IS_ADDR_V4MAPPED][0]
  • Stack Exchange: [Convince apt-get not to use IPv6 method][1]

Back to posts