我尝试更新 Debian 但收到以下错误消息:
% sudo aptitude update
Hit http://deb.debian.org/debian bullseye InRelease
Hit http://deb.debian.org/debian-security bullseye-security InRelease
Hit http://deb.debian.org/debian bullseye-updates InRelease
Get: 1 https://cli.github.com/packages stable InRelease [3917 B]
Hit http://packages.azlux.fr/debian buster InRelease
Hit https://fasttrack.debian.net/debian-fasttrack bullseye-fasttrack InRelease
Hit https://fasttrack.debian.net/debian-fasttrack bullseye-backports-staging InRelease
Err https://cli.github.com/packages stable InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 23F3D4EA75716059
Hit https://packages.cloud.google.com/apt kubernetes-xenial InRelease
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://cli.github.com/packages stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 23F3D4EA75716059
W: Failed to fetch https://cli.github.com/packages/dists/stable/InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 23F3D4EA75716059
W: Some index files failed to download. They have been ignored, or old ones used instead.
这似乎与我的以下几行相关/etc/apt/sources.list.d/github-cli.list
:
deb [arch=amd64 signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main
那么,如何修复此签名错误?
答案1
那么,如何修复此签名错误?
公钥将于2022年9月2日到期。 这提供有关如何安装新证书的说明:
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& sudo apt update \
&& sudo apt install gh -y
答案2
我遇到了同样的错误,可以通过更新时钟来解决这个问题
sudo hwclock --hctosys
然后
sudo apt update
如果 PC 处于睡眠/休眠状态,则可能会导致硬件时钟不同步(我在 WSL2 上)。这导致 Linux 看到错误的时间,对于较新的存储库的更新来说太早了。