如何修复:由于公钥不可用,无法验证以下签名:NO_PUBKEY

我正在开发 Debian 8 上的嵌入式系统(待升级)。当我执行 apt update 时,我得到以下信息:

...
...
Hit http://deb.debian.org stable/contrib arm64 Packages
Hit http://deb.debian.org stable/non-free arm64 Packages                       
Fetched 116 kB in 19s (6011 B/s)                                               
Reading package lists... Done
Building dependency tree       
Reading state information... Done
109 packages can be upgraded. Run 'apt list --upgradable' to see them.
W: GPG error: http://deb.debian.org stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 648ACFD622F3D138 NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 605C66F00D6C9793

我试过了:

apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 

但得到:

Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.mXChDvLgjA --no-auto-check-trustdb --trust-model always --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyring /etc/apt/trusted.gpg.d/debian-archive-jessie-automatic.gpg --keyring /etc/apt/trusted.gpg.d/debian-archive-jessie-security-automatic.gpg --keyring /etc/apt/trusted.gpg.d/debian-archive-jessie-stable.gpg --keyring /etc/apt/trusted.gpg.d/debian-archive-squeeze-automatic.gpg --keyring /etc/apt/trusted.gpg.d/debian-archive-squeeze-stable.gpg --keyring /etc/apt/trusted.gpg.d/debian-archive-wheezy-automatic.gpg --keyring /etc/apt/trusted.gpg.d/debian-archive-wheezy-stable.gpg --keyserver hkp://p80.pool.sks-keyserver.net:80 --recv-keys 605C66F00D6C9793
gpg: requesting key 0D6C9793 from hkp server p80.pool.sks-keyserver.net
?: p80.pool.sks-keyserver.net: Host not found
gpgkeys: HTTP fetch error 7: couldn't connect: No such file or directory
gpg: no valid OpenPGP data found.
gpg: Total number processed: 0

我也试过:

# gpg --keyserver pgp.mit.edu --recv-keys 648ACFD622F3D138 0E98404D386FA1D9 605C66F00D6C9793

返回:

gpg: requesting key 22F3D138 from hkp server pgp.mit.edu
gpg: requesting key 386FA1D9 from hkp server pgp.mit.edu
gpg: requesting key 0D6C9793 from hkp server pgp.mit.edu
gpg: /root/.gnupg/trustdb.gpg: trustdb created
gpg: key 3CBBABEE: public key "Debian Archive Automatic Signing Key (10/buster) <ftpmaster@debian.org>" imported
gpg: key 8DD47936: public key "Debian Archive Automatic Signing Key (11/bullseye) <ftpmaster@debian.org>" imported
gpg: key 0D6C9793: public key "Debian Stable Release Key (11/bullseye) <debian-release@lists.debian.org>" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 3
gpg:               imported: 3  (RSA: 3)

并且在病房之后运行 # apt update 仍然会给我 NO_PUBKEY 错误。如何正确解决此问题?我的来源如下:

cat /etc/apt/sources.list.d/multistrap-debian.list 
deb [arch=arm64] http://deb.debian.org/debian stable main contrib non-free
deb-src http://deb.debian.org/debian stable main contrib non-free
stack overflow How to fix: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY
原文答案

答案:

作者头像

我能够通过以下方式解决此问题:

# apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 605C66F00D6C9793
# apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0E98404D386FA1D9
# apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138

看起来 ubuntu 服务器也包含 debian 密钥。