如何解决此 GPG 错误?

如何解决此 GPG 错误?

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

Get:1 https://cli.github.com/packages stable InRelease [3 743 B]
Hit:2 http://ppa.launchpad.net/git-core/ppa/ubuntu focal InRelease                                                                                                      
Err:1 https://cli.github.com/packages stable InRelease                                                                                                                  
  The following signatures were invalid: EXPKEYSIG C99B11DEB97541F0 Nate Smith <[email protected]>
Hit:3 http://ppa.launchpad.net/zorinos/apps/ubuntu focal InRelease                                                                                                      
Hit:4 http://ppa.launchpad.net/zorinos/drivers/ubuntu focal InRelease                                                                                                   
Hit:5 http://security.ubuntu.com/ubuntu focal-security InRelease                                                                        
Hit:6 http://ppa.launchpad.net/zorinos/patches/ubuntu focal InRelease                                                                          
Hit:7 http://ppa.launchpad.net/zorinos/stable/ubuntu focal InRelease                                                                           
Hit:8 https://packages.zorinos.com/stable focal InRelease                                                         
Hit:9 https://packages.zorinos.com/patches focal InRelease    
Hit:10 https://packages.zorinos.com/apps focal InRelease      
Hit:11 https://packages.zorinos.com/drivers focal InRelease   
Hit:12 http://se.archive.ubuntu.com/ubuntu focal InRelease    
Hit:13 http://se.archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:14 http://se.archive.ubuntu.com/ubuntu focal-backports InRelease
Reading package lists... Done
W: GPG error: https://cli.github.com/packages stable InRelease: The following signatures were invalid: EXPKEYSIG C99B11DEB97541F0 Nate Smith <[email protected]>
E: The repository 'https://cli.github.com/packages stable 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.

我已尝试使用下面的命令来清除我的缓存?

sudo rm /var/lib/apt/lists/* -vf
sudo apt-get clean
sudo apt-get update
sudo apt-get upgrade

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

答案1

按照命令修复错误。

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

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

相关内容