Score:0

How can I fixe missing keys errors?

us flag

I really need your help as a fresher in linux :/

I have deleted the folder trusted.gpg.d located in /etc/apt/ and also deleted /etc/apt/sources.list.d.

Now when I try to update I receive these errors:

Err:2 LINKpt.archive.ubuntu.com/ubuntu focal-updates InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY **<My_Key_Missingg1>** NO_PUBKEY  **<My_Key_Missingg2>**
Err:3 LINKpt.archive.ubuntu.com/ubuntu focal-backports InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY **<My_Key_Missingg1>** NO_PUBKEY  **<My_Key_Missingg2>**
Err:4 LINKpt.archive.ubuntu.com/ubuntu focal-security InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY **<My_Key_Missingg1>** NO_PUBKEY  **<My_Key_Missingg2>**
Err:5 LINKppa.launchpad.net/webupd8team/y-ppa-manager/ubuntu focal InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY **<My_Key_Missingg3>**
Get:9 LINKmaven.xwiki.org stable/ Packages [352 kB]
Reading package lists... Done
W: GPG error: LINKpt.archive.ubuntu.com/ubuntu focal InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY **<My_Key_Missingg1>** NO_PUBKEY  **<My_Key_Missingg2>**
E: The repository 'LINKpt.archive.ubuntu.com/ubuntu focal InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: LINKpt.archive.ubuntu.com/ubuntu focal-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY **<My_Key_Missingg1>** NO_PUBKEY  **<My_Key_Missingg2>**
E: The repository 'LINKpt.archive.ubuntu.com/ubuntu focal-updates InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: LINKpt.archive.ubuntu.com/ubuntu focal-backports InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY **<My_Key_Missingg1>** NO_PUBKEY  **<My_Key_Missingg2>**
E: The repository 'LINKpt.archive.ubuntu.com/ubuntu focal-backports InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: LINKpt.archive.ubuntu.com/ubuntu focal-security InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY **<My_Key_Missingg1>** NO_PUBKEY  **<My_Key_Missingg2>**
E: The repository 'LINKpt.archive.ubuntu.com/ubuntu focal-security InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: LINKppa.launchpad.net/webupd8team/y-ppa-manager/ubuntu focal InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY **<My_Key_Missingg3>**
E: The repository 'http://ppa.launchpad.net/webupd8team/y-ppa-manager/ubuntu focal InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

NOTE - I've changed http:// to LINK to be able to submit this question.

I have tried a bunch of suggestion like:

1 - apt install extundelete to recover the files. And receive this error: E: Unable to locate package extundelete

2 - sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv-keys **<MY KEY>** (I've tried with and without hkp://)

3 - apt-get install ubuntu-keyring and similar errors about NO_PUBKEYS

4 - gpg --keyserver pgpkeys.mit.edu --recv-key **<MY KEY>** gpg -a --export **<MY KEY>** | sudo apt-key add . and got de error: gpg: keyserver receive failed: End of file; gpg: WARNING: nothing exported gpg: .: read error: Is a directory gpg: no valid OpenPGP data found.

5- I have already used this one too unsuccessfully sudo apt update 2>&1 1>/dev/null | sed -ne 's/.*NO_PUBKEY //p' | while read key; do if ! [[ ${keys[*]} =~ "$key" ]]; then sudo apt-key adv --keyserver hkp://pool.sks-keyservers.net:80 --recv-keys "$key"; keys+=("$key"); fi; done

Anyone can help me please?

David avatar
cn flag
First why did you delete what you did? Were you trying to do something?
us flag
I tried unsuccessfully to install a wiki software, and then I uninstalled correctly using the apt-get --purge remove <wikinameapp> and apt-get --purge autoremove. When I tried to install it again, and I noticed that was some other content remains from the previous installation. I follow the path where was the duplicated files (/etc/apt/sources.list.d) and removed thinking that all the contents were installed by me. I also did a ls -ls to see the hours of the last installations and the folder trusted.gpg.d was in the same time, so I did delete that also thinking that was installed by me.
us flag
Thanks David, I know that I messed up.....
David avatar
cn flag
Time for a complete re install I would suggest.
N0rbert avatar
zw flag
Full normal output `sudo apt update` is needed. Upload it to pastebin. Do you use proxy?
karel avatar
sa flag
Does this answer your question? [How do I fix the GPG error "NO\_PUBKEY"?](https://askubuntu.com/questions/13065/how-do-i-fix-the-gpg-error-no-pubkey)
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.