Force apt to IPv4

Sometimes a remote host or your ISP is temporarily misconfigured with regard to IPv6. In this case, apt update can simply hang, for example:

Connecting to archive.raspberrypi.org (2a00:1098:0:80:1000:13:0:5)

apt is forced to use IPv4 with “apt” option -o Acquire::ForceIPv4=true.

Example:

apt -o Acquire::ForceIPv4=true update

apt -o Acquire::ForceIPv4=true upgrade