如何解决这个 GPG 错误?

Jon*_* YH 3 apt sudo

当我尝试更新和升级我的 apt 时,出现以下错误:

\n
Get:1 https://cli.github.com/packages stable InRelease [3\xe2\x80\xaf743 B]\nHit:2 http://ppa.launchpad.net/git-core/ppa/ubuntu focal InRelease                                                                                                      \nErr:1 https://cli.github.com/packages stable InRelease                                                                                                                  \n  The following signatures were invalid: EXPKEYSIG C99B11DEB97541F0 Nate Smith <vilmibm@github.com>\nHit:3 http://ppa.launchpad.net/zorinos/apps/ubuntu focal InRelease                                                                                                      \nHit:4 http://ppa.launchpad.net/zorinos/drivers/ubuntu focal InRelease                                                                                                   \nHit:5 http://security.ubuntu.com/ubuntu focal-security InRelease                                                                        \nHit:6 http://ppa.launchpad.net/zorinos/patches/ubuntu focal InRelease                                                                          \nHit:7 http://ppa.launchpad.net/zorinos/stable/ubuntu focal InRelease                                                                           \nHit:8 https://packages.zorinos.com/stable focal InRelease                                                         \nHit:9 https://packages.zorinos.com/patches focal InRelease    \nHit:10 https://packages.zorinos.com/apps focal InRelease      \nHit:11 https://packages.zorinos.com/drivers focal InRelease   \nHit:12 http://se.archive.ubuntu.com/ubuntu focal InRelease    \nHit:13 http://se.archive.ubuntu.com/ubuntu focal-updates InRelease\nHit:14 http://se.archive.ubuntu.com/ubuntu focal-backports InRelease\nReading package lists... Done\nW: GPG error: https://cli.github.com/packages stable InRelease: The following signatures were invalid: EXPKEYSIG C99B11DEB97541F0 Nate Smith <vilmibm@github.com>\nE: The repository 'https://cli.github.com/packages stable InRelease' is not signed.\nN: Updating from such a repository can't be done securely, and is therefore disabled by default.\nN: See apt-secure(8) manpage for repository creation and user configuration details.\n
Run Code Online (Sandbox Code Playgroud)\n

我尝试过使用下面的命令来刷新我的缓存?

\n
sudo rm /var/lib/apt/lists/* -vf\nsudo apt-get clean\nsudo apt-get update\nsudo apt-get upgrade\n
Run Code Online (Sandbox Code Playgroud)\n

但它没有起作用我该如何解决这个问题?

\n

小智 9

按照命令修复错误。

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
Run Code Online (Sandbox Code Playgroud)

注释参考:https://github.com/cli/cli/blob/trunk/docs/install_linux.md#debian-ubuntu-linux-raspberry-pi-os-apt