2

I have added a new source

deb http://httpredir.debian.org/debian buster-backports main contrib

to my source list file on my raspberry pi. When I update my sudo apt to confirm the changes, I get this error:

sudo apt update
Hit:1 http://raspbian.raspberrypi.org/raspbian buster InRelease
Get:2 http://httpredir.debian.org/debian buster-backports InRelease [46.7 kB]
Get:3 http://archive.raspberrypi.org/debian buster InRelease [32.6 kB]
Err:2 http://httpredir.debian.org/debian buster-backports InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 04EE7237B7D453EC NO_PUBKEY 648ACFD622F3D138
Get:4 http://archive.raspberrypi.org/debian buster/main armhf Packages [330 kB]
Reading package lists... Done
W: GPG error: http://httpredir.debian.org/debian buster-backports InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 04EE7237B7D453EC NO_PUBKEY 648ACFD622F3D138
E: The repository 'http://httpredir.debian.org/debian buster-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.

I was given these instructions to follow:

gpg --recv-keys 04EE7237B7D453EC
gpg --recv-keys 648ACFD622F3D138
gpg --export 04EE7237B7D453EC | sudo apt-key add -
gpg --export 648ACFD622F3D138 | sudo apt-key add -

But when I carry out this command:

gpg --recv-keys 04EE7237B7D453EC

I get this error:

gpg: key E0B11894F66AEC98: new key but contains no user ID - skipped
gpg: Total number processed: 1
gpg:           w/o user IDs: 1

Should that output occur? I followed the instructions but still got the previous errors, public key is not available implies their is something wrong with my keys.

1 Answer 1

2

I found the answer:

The package manager needs to have the PGP keys to verify package sets from the new repository. You first have to fetch the keys from a keyserver, e.g. the SKS one:

$ gpg --recv-keys --keyserver ipv4.pool.sks-keyservers.net 04EE7237B7D453EC
gpg: key E0B11894F66AEC98: public key "Debian Archive Automatic Signing Key (9/stretch) <[email protected]>" imported
gpg: Total number processed: 1
gpg:               imported: 1
$ gpg --recv-keys --keyserver ipv4.pool.sks-keyservers.net 648ACFD622F3D138
gpg: key DC30D7C23CBBABEE: public key "Debian Archive Automatic Signing Key (10/buster) <[email protected]>" imported
gpg: Total number processed: 1
gpg:               imported: 1

then import them into your local APT key store:

$ gpg --export 04EE7237B7D453EC | sudo apt-key add -
OK
$ gpg --export 648ACFD622F3D138 | sudo apt-key add -
OK

Then your apt update should work.

2
  • 1
    BTW for Debian packages, one should probably use --keyserver keyring.debian.org Commented Dec 14, 2020 at 17:05
  • It wasn't that you weren't using a keyserver before, it's just that the default keyserver was stripping the user IDs from the keys. This answer explains why. Commented Dec 16, 2021 at 20:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .