Force Apt-Get to use IPv4 or IPv6 on Ubuntu or Debian
Recently I transitioned my home network to dual-stack IPv4 / IPv6 and I noticed a strange issue on a number of my Debian-running servers: some of the apt updates were unable to complete. The issue seems to be lying in some of my (official) Debian sources being un-accessible via IPv6.
To resolve this, I edited a file:
sudo nano /etc/apt/apt.conf.d/99force-ipv4I added the following line:
Acquire::ForceIPv4 "true";After that I ran an apt update:
sudo apt update && sudo apt -y upgradeThis resolved my issue with IPv6 and Debian apt sources.
Member discussion