Ubuntu 18.04 add gpg key failed with gpg-agent not found error

36.1k Views Asked by At

trying to migrate our base image to the stable Ubuntu 18.04, when we try to add our gpg key, getting this error:

root@77ff14f29cab:/# apt-key add apt-key.gpg 
gpg: failed to start agent '/usr/bin/gpg-agent': No such file or directory
gpg: can't connect to the agent: No such file or directory
gpg: failed to start agent '/usr/bin/gpg-agent': No such file or directory
gpg: can't connect to the agent: No such file or directory
1

There are 1 best solutions below

0
On BEST ANSWER

You are missing the gpg-agent package, most likely:

gpg-agent/testing,unstable,now 2.2.5-1 amd64 [installed,automatic]
  GNU privacy guard - cryptographic agent

The command you should run is:

apt install gpg-agent