Score:0

Randomly get: gpg: keyserver receive failed: Cannot assign requested address

us flag

I want to add new repositories on Ubuntu 18.04 and randomly get the following error:

gpg: keyserver receive failed: Cannot assign requested address

Randomly, as in, the same command sometimes works and sometimes doesn't. When it doesn't, I just rerun it and eventually it works.

I've seen related questions, like this one but there are no satisfactory solutions. I didn't have this problem is the last few weeks, so something must have changed. On my side I believe nothing has changed, there are no reports that the keyserver is down or degraded, so I'm at a loss...

To reproduce this issue using docker:

  1. Run docker run -it --rm ubuntu:18.04
  2. In the docker container, run: apt update && apt install gnupg2 -y
  3. Try to add the repository key, this one is from ROS Spanshot: apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 4B63CF8FDE49746E98FA01DDAD19BAB3CBF125EA, you may also try the key to Git PPA repository: apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys A1715D88E1DF1F24

The last step often fails with:

Executing: /tmp/apt-key-gpghome.FhnZLWMBd1/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 4B63CF8FDE49746E98FA01DDAD19BAB3CBF125EA
gpg: keyserver receive failed: Cannot assign requested address

But if I rerun the same command, it will eventually work and output:

Executing: /tmp/apt-key-gpghome.x0bEOm55IF/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 4B63CF8FDE49746E98FA01DDAD19BAB3CBF125EA
gpg: key AD19BAB3CBF125EA: public key "ROS Spanshot builder <rosbuild@ros.org>" imported
gpg: Total number processed: 1
gpg:               imported: 1
guiverc avatar
cn flag
Ubuntu 18.04 is EOSS (*end-of-standard-support*) thus off-topic on this site (refer https://askubuntu.com/help/on-topic) unless your question is specifically about moving to a *fully supported* release of Ubuntu. Being EOSS, mirrors can drop the release. Refer https://help.ubuntu.com/community/EOLUpgrades https://fridge.ubuntu.com/2023/06/17/extended-security-maintenance-for-ubuntu-18-04-lts-began-on-may-31-2023/
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.