Running gnupg version 2.1.22 on an IPv4 only linux system fails to connect to keyservers, i.e. I get the error message
gpg: keyserver send failed: Address family not supported by protocol
When I enable IPv6 by loading the ipv6 kernel module the error goes away andd everything works as expected.
Specifically:
gpg -vv --debug-all --keyserver keyring.debian.org --recv-keys ...
gpg: Optionen werden aus '/home/gerddie/.gnupg/gpg.conf' gelesen
gpg: enabled debug flags: packet mpi crypto filter iobuf memory cache memstat trust hashing ipc clock lookup extprog
gpg: DBG: [not enabled in the source] start
gpg: DBG: chan_3 <- # Home: /home/gerddie/.gnupg
gpg: DBG: chan_3 <- # Config: [none]
gpg: DBG: chan_3 <- OK Dirmngr 2.1.22 at your service
gpg: DBG: connection to the dirmngr established
gpg: DBG: chan_3 -> GETINFO version
gpg: DBG: chan_3 <- D 2.1.22
gpg: DBG: chan_3 <- OK
gpg: DBG: chan_3 -> KEYSERVER --clear hkp://keyring.debian.org
gpg: DBG: chan_3 <- OK
gpg: DBG: chan_3 -> KS_GET -- 0xD5C2F9BFCA128BBA22A77218872F702C4D6E25A8
gpg: DBG: chan_3 <- ERR 167804933 Address family not supported by protocol <Dirmngr>
gpg: Failed to receive from key server: Address family not supported by protocol
gpg: DBG: chan_3 -> BYE
gpg: DBG: [not enabled in the source] stop
gpg: keydb: handles=0 locks=0 parse=0 get=0
gpg: build=0 update=0 insert=0 delete=0
gpg: reset=0 found=0 not=0 cache=0 not=0
gpg: kid_not_found_cache: count=0 peak=0 flushes=0
gpg: sig_cache: total=0 cached=0 good=0 bad=0
gpg: random usage: poolsize=600 mixed=0 polls=0/0 added=0/0
outmix=0 getlvl1=0/0 getlvl2=0/0
gpg: secmem usage: 0/65536 bytes in 0 blocks
The same command worked fine with version 2.1.15.
see also Debian #870806
best,
Gert