今天SSH连到服务器,yum update时报错:

warning: /var/cache/yum/x86_64/7/mysql80-community/packages/mysql-community-client-8.0.28-1.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

The GPG keys listed for the "MySQL 8.0 Community Server" repository are already installed but they are not correct for this package.
Check that the correct key URLs are configured for this repository.

Failing package is: mysql-community-client-8.0.28-1.el7.x86_64
GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

查了下/etc/pki/rpm-gpg/目录下也有 RPM-GPG-KEY-mysql文件 ,修改日期为2019-4-25

百度时有人建议修改/etc/yum/repos.d/mysql-community.repo配置,将gpgcheck值改为0,跳过验证。

[mysql80-community]
name=MySQL 8.0 Community Server
baseurl=http://repo.mysql.com/yum/mysql-8.0-community/el/7/$basearch/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

仔细想想这也不是长远之计,于是跑到mysql官网上看了一下。原来是密钥过期了(原文见https://bugs.mysql.com/bug.php?id=106188),现在官方推出了新密钥,更新一下便可。

# rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
# yum update -y

一切恢复正常~

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注