DEV Community


TetraQuicky07: Ubuntu apt-get key errors

tetractius profile image tetractius ・2 min read

Every now and then in ubuntu, you might get this error while updating package with apt:

$ sudo apt update
Err:6 bionic InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 291F9FF6FD385783

This might be several causes of this issue. The GPG signature server could have been temporarily down so you can re-force it simply by running:

sudo apt-key adv --keyserver --recv-keys 291F9FF6FD385783

Using the same key that is normally causing you trouble (in this instance 291F9FF6FD385783)

However recently I noticed that in some environment behind a strict proxy rules, and for example also under WSL in Windows, the access to the is actually blocked and cannot be reached.
This, for example, will give you the following error:

$ sudo apt-key adv --keyserver --recv-keys 291
Executing: /tmp/apt-key-gpghome.nR1O15nnkM/ --keyserver --recv-keys 291F9FF6FD385783
gpg: keyserver receive failed: Server indicated a failure

I just discovered that you can use the port 80 for this. So, it is enough to just for something like:

sudo apt-key adv --keyserver hkp:// --recv
Executing: /tmp/apt-key-gpghome.prdsQcWrls/ --keyserver hkp:// --recv 291F9FF6FD385783
gpg: key A8E5EF3A02600268: public key "Kitware Apt Archive Automatic Signing Key (2020) <>" imported
gpg: Total number processed: 1
gpg:               imported: 1
Reading package lists... Done
Building dependency tree
Reading state information... Done

And puff the trick is done.

P.S. ... yes use this kitware ppa to have always the latest cmake version available in ubuntu. I highly recommend it.

Discussion (0)

Editor guide