如何删除未出现在 apt-key 列表中的 GPG 密钥?

如何删除未出现在 apt-key 列表中的 GPG 密钥?

我正在使用 Ubuntu 18。当我尝试运行软件包更新时,它因此错误而终止

$ sudo apt update
[sudo] password for davea: 
Hit:1 https://dl.yarnpkg.com/debian stable InRelease
Hit:2 https://deb.nodesource.com/node_14.x bionic InRelease                                             
Hit:3 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu bionic InRelease                                   
Hit:4 http://security.ubuntu.com/ubuntu bionic-security InRelease                                       
Get:5 http://repo.mysql.com/apt/ubuntu bionic InRelease [20.0 kB]                                       
Hit:6 http://iad-2.clouds.archive.ubuntu.com/ubuntu bionic InRelease                                    
Hit:7 http://ppa.launchpad.net/ubuntugis/ppa/ubuntu bionic InRelease                                    
Hit:8 http://iad-2.clouds.archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:9 http://iad-2.clouds.archive.ubuntu.com/ubuntu bionic-backports InRelease
Err:5 http://repo.mysql.com/apt/ubuntu bionic InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 467B942D3A79BD29
Reading package lists... Done
W: GPG error: http://repo.mysql.com/apt/ubuntu bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 467B942D3A79BD29
E: The repository 'http://repo.mysql.com/apt/ubuntu 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.

但当我尝试找到过期的密钥并将其删除时,它没有出现

$ sudo apt-key list
/etc/apt/trusted.gpg
--------------------
pub   rsa4096 2016-10-05 [SC]
      72EC F46A 56B4 AD39 C907  BBB7 1646 B01B 86E5 0310
uid           [ unknown] Yarn Packaging <[email protected]>
sub   rsa4096 2016-10-05 [E]
sub   rsa4096 2019-01-02 [S] [expires: 2023-01-24]
sub   rsa4096 2019-01-11 [S] [expires: 2023-01-24]

pub   rsa4096 2014-06-13 [SC]
      9FD3 B784 BC1C 6FC3 1A8A  0A1C 1655 A0AB 6857 6280
uid           [ unknown] NodeSource <[email protected]>
sub   rsa4096 2014-06-13 [E]

/etc/apt/trusted.gpg.d/deadsnakes_ubuntu_ppa.gpg
------------------------------------------------
pub   rsa4096 2017-07-29 [SC]
      F23C 5A6C F475 9775 95C8  9F51 BA69 3236 6A75 5776
uid           [ unknown] Launchpad PPA for deadsnakes

/etc/apt/trusted.gpg.d/ubuntu-keyring-2012-archive.gpg
------------------------------------------------------
pub   rsa4096 2012-05-11 [SC]
      790B C727 7767 219C 42C8  6F93 3B4F E6AC C0B2 1F32
uid           [ unknown] Ubuntu Archive Automatic Signing Key (2012) <[email protected]>

/etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cdimage.gpg
------------------------------------------------------
pub   rsa4096 2012-05-11 [SC]
      8439 38DF 228D 22F7 B374  2BC0 D94A A3F0 EFE2 1092
uid           [ unknown] Ubuntu CD Image Automatic Signing Key (2012) <[email protected]>

/etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg
------------------------------------------------------
pub   rsa4096 2018-09-17 [SC]
      F6EC B376 2474 EDA9 D21B  7022 8719 20D1 991B C93C
uid           [ unknown] Ubuntu Archive Automatic Signing Key (2018) <[email protected]>

/etc/apt/trusted.gpg.d/ubuntugis_ubuntu_ppa.gpg
-----------------------------------------------
pub   rsa1024 2009-05-10 [SC]
      6B82 7C12 C2D4 25E2 27ED  CA75 089E BE08 314D F160
uid           [ unknown] Launchpad ubuntugis-stable

我如何删除阻止我更新的 mysql 键?

答案1

只需安装公钥即可。

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 467B942D3A79BD29

然后再次运行sudo apt update

相关内容