GPG密钥为新密钥,但不包含用户ID

时间:2020-06-16 10:27:26

标签: linux networking key gnupg

我添加了一个新来源

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

到我的树莓派上的源列表文件。当我更新sudo apt以确认更改时,出现此错误:

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.

已向我提供了以下说明:

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

但是当我执行此命令时:

gpg --recv-keys 04EE7237B7D453EC

我收到此错误:

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

是否应该输出?我按照说明进行操作,但仍然遇到先前的错误,public key is not available表示我的键有问题。

1 个答案:

答案 0 :(得分:3)

我找到了答案:

程序包管理器需要具有PGP密钥,才能从新存储库验证程序包集。 您首先必须从密钥服务器获取密钥,例如SKS之一:

$ gpg --recv-keys --keyserver ipv4.pool.sks-keyservers.net 04EE7237B7D453EC
gpg: key E0B11894F66AEC98: public key "Debian Archive Automatic Signing Key (9/stretch) <ftpmaster@debian.org>" 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) <ftpmaster@debian.org>" imported
gpg: Total number processed: 1
gpg:               imported: 1

然后将它们导入本地APT密钥存储区:

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

然后您的apt更新应该可以使用。