2

please I need help. I tried to install osquery on my Ubuntu and this is what I am getting:

Err:5 http://gb.archive.ubuntu.com/ubuntu jammy InRelease                      
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
Err:9 https://ppa.launchpadcontent.net/jonathonf/vim/ubuntu jammy InRelease    
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 8CF63AD3F06FC659
Get:1 https://osquery-packages.s3.us-east-1.amazonaws.com/deb deb InRelease [69.9 kB]
Err:8 http://gb.archive.ubuntu.com/ubuntu jammy-updates InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
Err:11 http://gb.archive.ubuntu.com/ubuntu jammy-backports InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
Err:12 http://gb.archive.ubuntu.com/ubuntu jammy-security InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
Err:1 https://osquery-packages.s3.us-east-1.amazonaws.com/deb deb InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 97A80C63C9D8B80B

I have tried removing the keys but I keep getting this. I will really appreciate it.

sotirov
  • 3,169
Kenneth Shibaba
  • 53
  • 1
  • 1
  • 7

1 Answers1

4

Try

$> gpg --keyserver keyserver.ubuntu.com --recv-keys 871920D1991BC93C  

And then

$> gpg --export --armor 871920D1991BC93C | sudo apt-key add - && sudo apt-get update 

Repeat for each of your missing keys - you seem to have several.

Edit:

After version 22.04 apt-key is apparently deprecated

From the manpages

   If your existing use of apt-key add looks like this:

wget -qO- https://myrepo.example/myrepo.asc | sudo apt-key add -

Then you can directly replace this with the following (though note the recommendation below):

wget -qO- https://myrepo.example/myrepo.asc | sudo tee /etc/apt/trusted.gpg.d/myrepo.asc

karel
  • 114,770
  • Note that traditional apt-key add functionality is considered 'deprecated' nowadays. – Thomas Ward Aug 30 '23 at 18:36
  • Thank you so much for your reply. After I entered the second command, this is what I got.

    -Lenovo-IdeaPad-S340-14API:/etc/apt/sources.list.d# $> gpg --export --armor 871920D1991BC93C | sudo apt-key add - && sudo apt-get update Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)). $: command not found gpg: no valid OpenPGP data found.

    – Kenneth Shibaba Aug 30 '23 at 18:47
  • Following up on @ThomasWard comment. See the man page for apt-key here. I have updated my answer – Nikolaj Hansen Aug 30 '23 at 18:52
  • Hey Nikolaj thank you for your post. Am just abit stuck. So where it says myrepo.example, do I put the repository name? For example I am trying to install osquery and this is how all these began, – Kenneth Shibaba Aug 30 '23 at 19:00
  • The initial answer still works for me - you do get a warning message about deprecation. nikolaj@ThinkPad-X1:~$ uname -a Linux ThinkPad-X1 6.2.0-26-generic #26-Ubuntu SMP PREEMPT_DYNAMIC Mon Jul 10 23:39:54 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux nikolaj@ThinkPad-X1:~$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 23.04 Release: 23.04 Codename: lunar – Nikolaj Hansen Aug 30 '23 at 19:11
  • @ThomasWard Not looking good at all for me. Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/archive_uri-https_pkg_osquery_io_deb-jammy.list:1 and /etc/apt/sources.list.d/osquery.list:1 – Kenneth Shibaba Aug 30 '23 at 19:31
  • 1
    So remove one of them? Btw this is a seperate issue from the original post about missing public keys for your repository entries. – Nikolaj Hansen Aug 30 '23 at 19:32
  • @Nikolaj what I meant was start the process all over by sudo rm /etc/apt/sources.list.d/osquery.list sudo rm /etc/apt/trusted.gpg.d/osquery.asc No still on the same topic. Forgive me if I seem a bit ignorant to this. – Kenneth Shibaba Aug 30 '23 at 19:49