ubuntu-18.04gpg-agent

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


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

Solution

  • 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