sudo apt-get update 未连接到存储库-GPG 签名无效/存储库没有发布文件

sudo apt-get update 未连接到存储库-GPG 签名无效/存储库没有发布文件

每次我运行apt-get update,它都会弹出这个。当我尝试从apt-get install或下载东西时Ubuntu 软件中心,它不起作用。请帮忙。谢谢。

    Reading package lists... Done
W: GPG error: http://us.archive.ubuntu.com/ubuntu yakkety-updates Release: The following signatures were invalid: BADSIG 40976EAF437D05B5 Ubuntu Archive Automatic Signing Key <[email protected]>
E: The repository 'http://us.archive.ubuntu.com/ubuntu yakkety-updates Release' is no longer 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.
W: The repository 'http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu yakkety Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: The repository 'http://ppa.launchpad.net/gwendal-lebihan-dev/hexchat-stable/ubuntu yakkety Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: The repository 'http://ppa.launchpad.net/ubuntuhandbook1/audacity/ubuntu yakkety Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.

答案1

对于BADSIG错误

可能是签名不正确,要解决这个问题,请打开终端并输入:

sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 40976EAF437D05B5

在哪里40976EAF437D05B5是您的错误签名密钥,请使用此命令通过替换最后一个密钥来解决相应的错误。

然后,为了避免再次发生类似的问题,您可能需要清除apt软件缓存。

cd /var/lib/apt
sudo mv lists lists.old
sudo mkdir -p lists/partial
sudo apt update

对于does not have release file错误

该错误意味着您的存储库不兼容,例如:

  1. 死蛇(已停产)
  2. HexChat 稳定版
  3. 大胆

只需删除这些存储库即可消除错误,使用--remove参数add-apt-repository

sudo add-apt-repository --remove ppa:ubuntuhandbook1/audacity
sudo add-apt-repository --remove ppa:fkrull/deadsnakes-python2.7
sudo add-apt-repository --remove ppa:gwendal-lebihan-dev/hexchat-stable

答案2

我不是专家,但我觉得你的 GPG 缓存已损坏。尝试运行

    sudo apt-key update

这将恢复 Ubuntu 存储库的密钥。第三方存储库,我不知道如何修复。我认为最肮脏的解决方案是运行

    sudo apt-get update --allow-unauthenticated

不过,我强烈建议不要这么做。这会破坏你在运行更新时所拥有的任何安全性。

相关内容