安装 mysql-community-server 时出现 GPG 密钥问题

jig*_*mar 35 php mysql linux package

安装mysql-community-server时出现以下错误:

命令:

 sudo yum install mysql-community-server
Run Code Online (Sandbox Code Playgroud)

错误:

warning: /var/cache/yum/x86_64/2/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

Run Code Online (Sandbox Code Playgroud)

任何人都可以帮忙解决这个问题吗...

huy*_*tmb 121

来自: https: //dev.mysql.com/doc/refman/8.0/en/checking-rpm-signature.html

没有单独的签名。RPM 软件包具有内置的 GPG 签名和 MD5 校验和。

rpm 还支持直接从 URL 加载密钥:

rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2023
Run Code Online (Sandbox Code Playgroud)

  • 这对我在 Amazon linux 2 上有用 (16认同)
  • 曾在 Centos 7 上工作 (5认同)
  • 对于我的情况,在开头添加 sudo 是必要的 (3认同)
  • 在 centos 7.9 / aws ec2 上为我工作 - 使用“rpm import...” - 谢谢! (2认同)

小智 8

新版本的 GPG 密钥已更改。有关更多信息,请参阅: https://support.cpanel.net/hc/en-us/articles/4419382481815 ?input_string=gpg+keys+problem+with+mysql+5.7

解决此错误的步骤需要安装更新的 MySQL GPG。

  1. 对于现有系统,/etc/yum.repos.d/ 中的 MySQL 存储库文件需要将其“gpgkey”行调整为:

    gpgkey=https://repo.mysql.com/RPM-GPG-KEY-mysql-2022

调整后,再次运行更新:

/usr/local/cpanel/scripts/upcp
Run Code Online (Sandbox Code Playgroud)
  1. 对于新安装,您可以在运行安装程序之前导入密钥:

    rpm --导入https://repo.mysql.com/RPM-GPG-KEY-mysql-2022

乌班图:

wget -q -O https://repo.mysql.com/RPM-GPG-KEY-mysql-2022 | apt-key add -
Run Code Online (Sandbox Code Playgroud)


小智 3

我在两个仅 DNS 服务器上遇到了同样的问题。

我编辑了 /etd/yum.repos.d/Mysql57.repo 文件并将所有“gpgcheck=1”行更改为“gpgcheck=0”

然后我执行了 yum update

然后我编辑了 /etd/yum.repos.d/Mysql57.repo 文件并将所有“gpgcheck=0”行更改回“gpgcheck=1”

最后,我更新了cPanel软件。

  • 感谢您的回答,但我通过在 ```` sudo 之前运行 ```` sudo rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022 ```` 来解决它yum install mysql-community-server ```` 它工作正常! (2认同)