GPG key installation issue on Ubuntu 18.04

Asanka Vithanage
2 min readAug 5, 2021

I was trying to install an application on the Ubuntu18.04 machine and was trying to get GPG Key installed as a pre-requisite.

Btw GPG is the Gnu Privacy Guard and it is an implementation of OpenPGP (Open Pretty Good Privacy). It is an encryption technique that is used in a number of different applications such as code signing for Linux code repositories and source code repositories like GitHub.

— — Issue

I was using the following command provided by the application installation guide.

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 9CDB294B29A5B1E2E00C24C022E8EF3461A50EF6

But it was failing with a time out as below

ubuntu@ip-10-133-13-4:~$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 9CDB294B29A5B1E2E00C24C022E8EF3461A50EF6
Executing: /tmp/apt-key-gpghome.h7RuP9y3wX/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys 9CDB294B29A5B1E2E00C24C022E8EF3461A50EF6
gpg: keyserver receive failed: Connection timed out

According to several sources above command ideally should work.

https://askubuntu.com/questions/291035/how-to-add-a-gpg-key-to-the-apt-sources-keyring

— — Solution

After several trials and errors, I was able to install the key with the below command

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys…

--

--

Asanka Vithanage

Software Quality Assurance Professional, Problem Solver, SOA Tester, Automation Engineer, CI/CD Practitioner, DevOps enthusiast