如何立即删除导致 GPG 错误的软件包

如何立即删除导致 GPG 错误的软件包

因此有两个 PPA 在执行期间导致 GPG 警告sudo apt update

W: GPG error: https://brave-browser-apt-release.s3.brave.com bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4FE13824E3FFC656
E: The repository 'https://brave-browser-apt-release.s3.brave.com bionic 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.
W: GPG error: http://repository.spotify.com stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4773BD5E130D1D45
E: The repository 'http://repository.spotify.com 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.

我想从我的系统中删除这些 PPA,该如何做?

grep -r 'repository.spotify.com ' /etc/apt

输出

/etc/apt/sources.list.d/spotify.list:deb http://repository.spotify.com stable non-free


grep -r 'brave-browser-apt-release.s3.brave.com' /etc/apt

输出

/etc/apt/sources.list.d/brave-browser-release-bionic.list:deb [arch=amd64] https://brave-browser-apt-release.s3.brave.com/ bionic main
/etc/apt/sources.list.d/brave-browser-release-bionic.list.save:deb [arch=amd64] https://brave-browser-apt-release.s3.brave.com/ bionic main

答案1

重新安装程序,但删除 中的相应文件/etc/apt/sources.list.d/。对于 Brave,使用命令查看是否有相应的文件

ls /etc/apt/sources.list.d/brave-browser-*.list

之前,删除它

sudo rm /etc/apt/sources.list.d/brave-browser-*.list

答案2

您可以直接编辑(PPA)repo 文件,并删除您想要删除的条目:

sudo nano /etc/apt/sources.list

或者使用 add-apt-repository 命令,带上 -r 开关来删除:

sudo add-apt-repository -r ppa:<repo name>

“repo 名称” - 要添加的 apt 存储库源代码行。这是以下之一:

  1. 引号中的完整恰当语句,
  2. 一个 repo url 和引号中的区域(区域默认为 'main'),
  3. PPA 快捷方式,
  4. 发行版组件。

例子:

apt-add-repository 'deb http://myserver/path/to/repo stable myrepo'
apt-add-repository 'http://myserver/path/to/repo myrepo'
apt-add-repository 'https://packages.medibuntu.org free non-free'
apt-add-repository http://extras.ubuntu.com/ubuntu
apt-add-repository ppa:user/repository
apt-add-repository multiverse

然后更新 repo 列表:

sudo apt update

要删除相应的 repo 密钥(尽管您的密钥丢失了,所以不需要):

:> sudo apt-key list # To list all the keys
/etc/apt/trusted.gpg.d/ubuntu-repo-archive.gpg
------------------------------------------------------
pub rsa4096 2018-01-01 [SC]
F6EC B376 2474 EDA9 D21B 7022 8719 20D1 991B C93C
uid [ unknown] Ubuntu Archive Automatic Signing Key
:> sudo apt-key del "991BC93C"    # Specify the key with full code, or just last 8 bytes
:> sudo apt update                # Update repos

相关内容