Trying to add keys in a Ubuntu 14.04 virtual machine using a makefile, but I keep running into an error, although I've tried several tricks like switching to port 80 or disabling firewall.

root@vm0083:~# make -f install_tools_and_libs.mk all
    for i in '51716619E084DAB9'; do echo "PUB_KEY: $i"; sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com $i; done
    PUB_KEY: 51716619E084DAB9
    Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.DAavGLrJ4i --no-auto-check-trustdb --trust-model always --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyring /etc/apt/trusted.gpg.d/ansible-ansible.gpg --keyring /etc/apt/trusted.gpg.d/fkrull-deadsnakes.gpg --keyring /etc/apt/trusted.gpg.d/puppetlabs-keyring.gpg --keyring /etc/apt/trusted.gpg.d/puppetlabs-nightly-keyring.gpg --keyring /etc/apt/trusted.gpg.d/x2go-stable.gpg --recv-keys --keyserver hkp://keyserver.ubuntu.com 51716619E084DAB9
    gpg: requesting key E084DAB9 from hkp server keyserver.ubuntu.com
    gpg: keyserver timed out
    gpg: keyserver receive failed: keyserver error
    make: *** [add_pub_key] Error 2

I'm not familiar with the public keys system, any idea what's wrong? I've used that same makefile successfully before in Ubuntu 14.04 in Virtual Box.


Looks like it is a problem related to a firewall blocking port 11371 or something like this. Anyway, I found a workaround here.

gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E084DAB9
gpg -a --export E084DAB9 | sudo apt-key add -
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.