apt-get update 爆炸-公钥丢失,如何添加它们?

apt-get update 爆炸-公钥丢失,如何添加它们?

apt-get update由于缺少公钥,我无法再这样做了。

Err:14 http://ppa.launchpad.net/webupd8team/java/ubuntu focal Release                                                              
  404  Not Found [IP: 2001:67c:1560:8008::19 80]
Ign:15 https://download.videolan.org/pub/debian/stable ./ InRelease         
Get:16 https://download.videolan.org/pub/debian/stable ./ Release [1.487 B]
Get:17 https://download.videolan.org/pub/debian/stable ./ Release.gpg [287 B]
Err:6 http://dl.google.com/linux/chrome/deb stable InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 78BD65473CB3BD13
Err:9 http://packages.microsoft.com/repos/edge stable InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY EB3E94ADBE1229CF
Err:10 http://apt.postgresql.org/pub/repos/apt focal-pgdg InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7FCC7D46ACCC4CF8
Ign:17 https://download.videolan.org/pub/debian/stable ./ Release.gpg
Reading package lists... Done
E: The repository 'http://ppa.launchpad.net/webupd8team/java/ubuntu focal Release' does not have a Release file.
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://dl.google.com/linux/chrome/deb stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 78BD65473CB3BD13
E: The repository 'http://dl.google.com/linux/chrome/deb 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.
W: GPG error: http://packages.microsoft.com/repos/edge stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY EB3E94ADBE1229CF
E: The repository 'http://packages.microsoft.com/repos/edge 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.
W: GPG error: http://apt.postgresql.org/pub/repos/apt focal-pgdg InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7FCC7D46ACCC4CF8
E: The repository 'http://apt.postgresql.org/pub/repos/apt focal-pgdg 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: https://download.videolan.org/pub/debian/stable ./ Release: Detached signature file '/var/lib/apt/lists/partial/download.videolan.org_pub_debian_stable_._Release.gpg' is in unsupported binary format
E: The repository 'https://download.videolan.org/pub/debian/stable ./ Release' 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.

当我尝试添加它们时,出现以下错误:

Executing: /tmp/apt-key-gpghome.xmyYXrwDlk/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys 78BD65473CB3BD13
gpg: key 7721F63BD38B4796: public key "Google Inc. (Linux Packages Signing Authority) <[email protected]>" imported
gpg: Total number processed: 1
gpg:               imported: 1
gpg: invalid key resource URL '/tmp/apt-key-gpghome.xmyYXrwDlk/home:ungoogled_chromium.asc.gpg'
gpg: keyblock resource '(null)': General error
gpg: key 6BCA5E4DB84288D9: 2 signatures not checked due to missing keys
gpg: key 02456C79B2FD48BF: 1 signature not checked due to a missing key
gpg: key 3B4FE6ACC0B21F32: 3 signatures not checked due to missing keys
gpg: key D94AA3F0EFE21092: 3 signatures not checked due to missing keys
gpg: key 871920D1991BC93C: 1 signature not checked due to a missing key
gpg: Total number processed: 10
gpg:       skipped new keys: 10

我该如何解决这些 gpg 问题?

答案1

你这里有一堆问题。

要修复这些问题,请使用“软件和更新”(software-properties-gtk)应用程序窗口,如下所示:

  1. 禁用ppa:webupd8team/java(它不提供适用于 20.04 LTS 的软件包并已停产)和download.videolan.org(它已经过时,最后的包来自2013 年、2016 年)转到“其他软件”选项卡,然后禁用它。

  2. 要修复 GPG 密钥问题,请转到“身份验证”选项卡并删除其他 GPG 密钥,以使此选项卡如下所示

    GPG 密钥

  3. 关闭软件和更新,不允许其运行软件列表重新加载

然后打开终端,删除损坏的软件列表,并通过以下命令添加新的 GPG 密钥:

sudo rm -rf /var/lib/apt/lists/*

cd /tmp
wget -c http://dl.google.com/linux/linux_signing_key.pub
sudo apt-key add linux_signing_key.pub

wget -c https://packages.microsoft.com/keys/microsoft.asc
sudo apt-key add microsoft.asc

wget -c https://www.postgresql.org/media/keys/ACCC4CF8.asc
sudo apt-key add ACCC4CF8.asc

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 78BD65473CB3BD13
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EB3E94ADBE1229CF
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys AB9660B9EB2CC88B
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7FCC7D46ACCC4CF8
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1E9377A2BA9EF27F

最后sudo apt-get update可选运行sudo apt-get dist-upgrade(以获取带有依赖项的最新升级)。

相关内容