0

I accidentally deleted some Debian gpg keys when testing out apt-key del. (I don't remember which key)

I have redownloaded the deb package and extracted the gpg keys. Then I used apt-key add to add those keys to the keyring. All 3 Debian Stretch keys have been added but I am still getting a missing public key warning from apt update

Ign:1 http://deb.debian.org/debian stable InRelease                                
Get:2 http://deb.debian.org/debian stable-updates InRelease [91.0 kB]              
Ign:3 http://download.opensuse.org/repositories/home:/ivaradi/Debian_9.0_update  InRelease
Err:2 http://deb.debian.org/debian stable-updates InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 8B48AD6246925553 NO_PUBKEY 7638D0442B90D010
Hit:4 https://dl.winehq.org/wine-builds/debian stretch InRelease
Ign:5 http://download.opensuse.org/repositories/home:/ivaradi/Debian_9.0  InRelease    
Get:6 http://deb.debian.org/debian-security stable/updates InRelease [94.3 kB]         
Err:6 http://deb.debian.org/debian-security stable/updates InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 9D6D8F6BC857C906 NO_PUBKEY 8B48AD6246925553
Ign:7 http://download.opensuse.org/repositories/home:/strycore/Debian_9.0 ./ InRelease
Hit:8 http://download.opensuse.org/repositories/home:/ivaradi/Debian_9.0_update  Release
Hit:10 http://deb.debian.org/debian stable Release                                                                
Hit:12 http://download.opensuse.org/repositories/home:/ivaradi/Debian_9.0  Release
Hit:14 http://download.opensuse.org/repositories/home:/strycore/Debian_9.0 ./ Release
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://deb.debian.org/debian stable-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 8B48AD6246925553 NO_PUBKEY 7638D0442B90D010
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://deb.debian.org/debian-security stable/updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 9D6D8F6BC857C906 NO_PUBKEY 8B48AD6246925553
W: Failed to fetch http://deb.debian.org/debian/dists/stable-updates/InRelease  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 8B48AD6246925553 NO_PUBKEY 7638D0442B90D010
W: Failed to fetch http://deb.debian.org/debian-security/dists/stable/updates/InRelease  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 9D6D8F6BC857C906 NO_PUBKEY 8B48AD6246925553
W: Some index files failed to download. They have been ignored, or old ones used instead.

Please let me know what keys are still missing.

Here is my apt-key list

/etc/apt/trusted.gpg
--------------------
pub   rsa4096 2017-05-22 [SC] [expires: 2025-05-20]
      6ED6 F5CB 5FA6 FB2F 460A  E88E EDA0 D238 8AE2 2BA9
uid           [ unknown] Debian Security Archive Automatic Signing Key (9/stretch) <ftpmaster@debian.org>
sub   rsa4096 2017-05-22 [S] [expires: 2025-05-20]

pub   rsa4096 2017-05-20 [SC] [expires: 2025-05-18]
      067E 3C45 6BAE 240A CEE8  8F6F EF0F 382A 1A7B 6500
uid           [ unknown] Debian Stable Release Key (9/stretch) <debian-release@lists.debian.org>

/etc/apt/trusted.gpg.d/debian-archive-stretch-automatic.gpg
-----------------------------------------------------------
pub   rsa4096 2017-05-22 [SC] [expires: 2025-05-20]
      E1CF 20DD FFE4 B89E 8026  58F1 E0B1 1894 F66A EC98
uid           [ unknown] Debian Archive Automatic Signing Key (9/stretch) <ftpmaster@debian.org>
sub   rsa4096 2017-05-22 [S] [expires: 2025-05-20]
  • The error message told you which keys are missing. Install those. – Michael Hampton Oct 30 '18 at 15:37
1

Try to re-import missing keys with following commands.

sudo su -
gpg --keyserver pgp.mit.edu --recv-keys 7638D0442B90D010 8B48AD6246925553
gpg --armor --export 7638D0442B90D010 | apt-key add -
gpg --armor --export 8B48AD6246925553 | apt-key add -
apt-get update
apt-get install -y debian-keyring debian-archive-keyring
apt-get update

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.