环境
CentOS Linux release 7.8.2003 (Core)
mysql 5.7.37
问题
# 配置源
wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
yum localinstall mysql57-community-release-el7-11.noarch.rpm
# 检查源
yum install -y mysql-community-server
CentOS 7 通过如上方式安装 Mysql,报错如下:
warning: /var/cache/yum/x86_64/7/mysql57-community/packages/mysql-community-libs-compat-5.7.37-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 5.7 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-libs-compat-5.7.37-1.el7.x86_64
GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
解决
新版本的 GPG 密钥已更改,MySQL GPG 密钥过期,阻止从官方存储库安装/升级 MySQL 包。查阅参考以获取更多信息。
需要安装更新的 MySQL GPG。对于现有系统,/etc/yum.repos.d/ 中的 MySQL 存储库文件需要将其“gpgkey”行调整为:
gpgkey=https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
调整后,再次运行更新:
/usr/local/cpanel/scripts/upcp
对于新安装,您可以在运行安装程序之前导入密钥:
rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
Ubuntu:
wget -q -O https://repo.mysql.com/RPM-GPG-KEY-mysql-2022 | apt-key add -
参考
forums.cpanel.net/threads/ups-421-mysql-5-7-36-5-7-37-upgrade-failed-due-to-gpg-keys-causing-upcp-rpmup-failure-warning-email.697217/
support.cpanel.net/hc/en-us/articles/4419382481815?input_string=gpg+keys+problem+with+mysql+5.7
www.jianshu.com/p/19291fb17b99