【mysql日常】Mysql客户端安装失败-GPG验证不通过
  TEZNKK3IfmPf 2023年11月12日 23 0

文章目录

    • 报错原文
    • 问题分析
    • 解决办法
    • 疑问

报错原文

当我输入命令:yum install mysql

[root@qbi-executor-01 mysql]# yum install mysql
Loaded plugins: fastestmirror, langpacks, releasever-adapter, update-motd
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-client.x86_64 0:5.7.38-1.el7 will be installed
--> Processing Dependency: mysql-community-libs(x86-64) >= 5.7.9 for package: mysql-community-client-5.7.38-1.el7.x86_64
--> Running transaction check
---> Package mariadb-libs.x86_64 1:5.5.68-1.1.al7 will be obsoleted
--> Processing Dependency: libmysqlclient.so.18()(64bit) for package: 2:postfix-2.10.1-9.1.al7.x86_64
--> Processing Dependency: libmysqlclient.so.18(libmysqlclient_18)(64bit) for package: 2:postfix-2.10.1-9.1.al7.x86_64
---> Package mysql-community-libs.x86_64 0:5.7.38-1.el7 will be obsoleting
--> Processing Dependency: mysql-community-common(x86-64) >= 5.7.9 for package: mysql-community-libs-5.7.38-1.el7.x86_64
--> Running transaction check
---> Package mysql-community-common.x86_64 0:5.7.38-1.el7 will be installed
---> Package mysql-community-libs-compat.x86_64 0:5.7.38-1.el7 will be obsoleting
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                      Arch    Version          Repository          Size
================================================================================
Installing:
 mysql-community-client       x86_64  5.7.38-1.el7     mysql57-community   28 M
 mysql-community-libs         x86_64  5.7.38-1.el7     mysql57-community  2.6 M
     replacing  mariadb-libs.x86_64 1:5.5.68-1.1.al7
 mysql-community-libs-compat  x86_64  5.7.38-1.el7     mysql57-community  1.2 M
     replacing  mariadb-libs.x86_64 1:5.5.68-1.1.al7
Installing for dependencies:
 mysql-community-common       x86_64  5.7.38-1.el7     mysql57-community  311 k

Transaction Summary
================================================================================
Install  3 Packages (+1 Dependent package)

Total size: 32 M
Is this ok [y/d/N]: y
Downloading packages:
warning: /var/cache/yum/x86_64/2.1903/mysql57-community/packages/mysql-community-client-5.7.38-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-client-5.7.38-1.el7.x86_64
 GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

直译过来:

为“MySQL 5.7 社区服务器”存储库列出的 GPG 密钥已安装,但它们对于此软件包不正确。检查是否为此存储库配置了正确的密钥 URL。

可以理解为:CentOS7.6 安装mysql5.7的时候报错,提示某一个包安装不成功。

操作系统:CentOS 7.5
Mysql版本:mysql5.7

总结失败原因:
GPG对于包的源key的验证没有通过

解决办法

在yum install 版本后面加上 --nogpgcheck,即可绕过GPG验证成功安装。比如命令:yum install mysql-community-server --nogpgcheck

[root@qbi-executor-01 mysql]# yum install mysql-community-server --nogpgcheck
Loaded plugins: fastestmirror, langpacks, releasever-adapter, update-motd
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-server.x86_64 0:5.7.38-1.el7 will be installed
--> Processing Dependency: mysql-community-common(x86-64) = 5.7.38-1.el7 for package: mysql-community-server-5.7.38-1.el7.x86_64
--> Processing Dependency: mysql-community-client(x86-64) >= 5.7.9 for package: mysql-community-server-5.7.38-1.el7.x86_64
--> Running transaction check
---> Package mysql-community-client.x86_64 0:5.7.38-1.el7 will be installed
--> Processing Dependency: mysql-community-libs(x86-64) >= 5.7.9 for package: mysql-community-client-5.7.38-1.el7.x86_64
---> Package mysql-community-common.x86_64 0:5.7.38-1.el7 will be installed
--> Running transaction check
---> Package mariadb-libs.x86_64 1:5.5.68-1.1.al7 will be obsoleted
--> Processing Dependency: libmysqlclient.so.18()(64bit) for package: 2:postfix-2.10.1-9.1.al7.x86_64
--> Processing Dependency: libmysqlclient.so.18(libmysqlclient_18)(64bit) for package: 2:postfix-2.10.1-9.1.al7.x86_64
---> Package mysql-community-libs.x86_64 0:5.7.38-1.el7 will be obsoleting
--> Running transaction check
---> Package mysql-community-libs-compat.x86_64 0:5.7.38-1.el7 will be obsoleting
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                      Arch    Version          Repository          Size
================================================================================
Installing:
 mysql-community-libs         x86_64  5.7.38-1.el7     mysql57-community  2.6 M
     replacing  mariadb-libs.x86_64 1:5.5.68-1.1.al7
 mysql-community-libs-compat  x86_64  5.7.38-1.el7     mysql57-community  1.2 M
     replacing  mariadb-libs.x86_64 1:5.5.68-1.1.al7
 mysql-community-server       x86_64  5.7.38-1.el7     mysql57-community  178 M
Installing for dependencies:
 mysql-community-client       x86_64  5.7.38-1.el7     mysql57-community   28 M
 mysql-community-common       x86_64  5.7.38-1.el7     mysql57-community  311 k

Transaction Summary
================================================================================
Install  3 Packages (+2 Dependent packages)

Total size: 209 M
Total download size: 178 M
Is this ok [y/d/N]: y
Downloading packages:
mysql-community-server-5.7.38-1.el7.x86_64.rpm             | 178 MB   00:16
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum. Installing : mysql-community-common-5.7.38-1.el7.x86_64                   1/6
  Installing : mysql-community-libs-5.7.38-1.el7.x86_64                     2/6
  Installing : mysql-community-client-5.7.38-1.el7.x86_64                   3/6
  Installing : mysql-community-server-5.7.38-1.el7.x86_64                   4/6
  Installing : mysql-community-libs-compat-5.7.38-1.el7.x86_64              5/6
  Erasing    : 1:mariadb-libs-5.5.68-1.1.al7.x86_64                         6/6
  Verifying  : mysql-community-libs-compat-5.7.38-1.el7.x86_64              1/6
  Verifying  : mysql-community-client-5.7.38-1.el7.x86_64                   2/6
  Verifying  : mysql-community-server-5.7.38-1.el7.x86_64                   3/6
  Verifying  : mysql-community-common-5.7.38-1.el7.x86_64                   4/6
  Verifying  : mysql-community-libs-5.7.38-1.el7.x86_64                     5/6
  Verifying  : 1:mariadb-libs-5.5.68-1.1.al7.x86_64                         6/6

Installed:
  mysql-community-libs.x86_64 0:5.7.38-1.el7
  mysql-community-libs-compat.x86_64 0:5.7.38-1.el7
  mysql-community-server.x86_64 0:5.7.38-1.el7

Dependency Installed:
  mysql-community-client.x86_64 0:5.7.38-1.el7
  mysql-community-common.x86_64 0:5.7.38-1.el7

Replaced:
  mariadb-libs.x86_64 1:5.5.68-1.1.al7

Complete!

看到上面的complet完成就神奇的成功了!

疑问

但是不明白包的源key为什么没有通过验证?这里很奇怪,我尝试了好几个5.7的版本都失败了,之前安装都是成功的,有明白相关信息的欢迎评论分享。

【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月12日 0

暂无评论

推荐阅读
  TEZNKK3IfmPf   2024年05月31日   24   0   0 mysql
  TEZNKK3IfmPf   2024年05月31日   26   0   0 sqlite数据库
  TEZNKK3IfmPf   2024年05月31日   29   0   0 数据库mysql
  TEZNKK3IfmPf   2024年05月31日   25   0   0 数据库mysql
TEZNKK3IfmPf