使用时出错:sudo apt update on ubuntu 22.04

使用时出错:sudo apt update on ubuntu 22.04

当我运行时出现此错误:sudo apt update在 ubuntu 22.04 的终端中

W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://download.opensuse.org/repositories/home:/Provessor/xUbuntu_20.04  InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 876292BF7F9C32BF
W: http://download.mono-project.com/repo/ubuntu/dists/trusty/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: Failed to fetch http://download.opensuse.org/repositories/home:/Provessor/xUbuntu_20.04/InRelease  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 876292BF7F9C32BF
W: Some index files failed to download. They have been ignored, or old ones used instead.

我尝试使用以下命令解决问题:sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 876292BF7F9C32BF但它不起作用并收到此消息

Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
Executing: /tmp/apt-key-gpghome.fbmSbmsKSu/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys 876292BF7F9C32BF
gpg: keyserver receive failed: No data

点击这里了解更多详情: https://i.stack.imgur.com/sehEd.png

请帮帮我 :(

答案1

我用这些命令解决了我的问题:

sudo rm -rf /var/lib/apt/lists/*
sudo rm -rf /etc/apt/sources.list.d/*
sudo apt-get update

:)

答案2

这个方法是已弃用为了安全问题:它允许您添加的任何签名密钥进行签名任何包,而不仅仅是该签名密钥存储库中的包。

更安全的方法是将密钥添加到类似位置/usr/share/keyrings/repository-name.gpg,然后从sources.list文件中引用它,例如

deb [signed-by=/usr/share/keyrings/some-repo.gpg] http://some.repo/apt dev main

学习更多关于文件sources.list格式或看这个例子添加 Xpra 密钥和存储库。

相关内容