warning: mysql-community-libs-5.7.11-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5

本文介绍在 CentOS 7 上通过 RPM 包安装 MySQL 的步骤与注意事项,包括解决依赖问题及使用官方源安装的方法。

1、错误描述

[root@ mysql]# rpm -ivh mysql-community-libs-5.7.11-1.el7.x86_64.rpm
warning: mysql-community-libs-5.7.11-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
error: Failed dependencies:
	mysql-community-common(x86-64) = 5.7.11-1.el7 is needed by mysql-community-libs-5.7.11-1.el7.x86_64
	mariadb-libs is obsoleted by mysql-community-libs-5.7.11-1.el7.x86_64

2、错误原因

[root@ mysql]# rpm -ivh mysql-community-client-5.7.11-1.el7.x86_64.rpm
warning: mysql-community-client-5.7.11-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
error: Failed dependencies:
	mysql-community-libs(x86-64) = 5.7.11-1.el7 is needed by mysql-community-client-5.7.11-1.el7.x86_64
[root@iZ949a99jvlZ mysql]# ls
mysql-community-client-5.7.11-1.el7.x86_64.rpm  mysql-community-libs-5.7.11-1.el7.x86_64.rpm
mysql-community-common-5.7.11-1.el7.x86_64.rpm  mysql-community-server-5.7.11-1.el7.x86_64.rpm
在Linux的Centos7下快速安装mysql,利用rpm -ivh命令,但是却出现一个一个的报错,结果发现是每个安装包需要相互依赖,必须有先后顺序;否则就会报错。


3、解决办法


按照官网上的安装包提示进行安装


[root@ mysql]# rpm -ivh mysql-community-release-el7-5.noarch.rpm
Preparing...                          ################################# [100%]
Updating / installing...
   1:mysql-community-release-el7-5    ################################# [100%]
[root@ mysql]# yum install mysql-community-server
Loaded plugins: langpacks
mysql-connectors-community                                                                                                                      | 2.5 kB  00:00:00     
mysql-tools-community                                                                                                                           | 2.5 kB  00:00:00     
mysql56-community                                                                                                                               | 2.5 kB  00:00:00     
(1/3): mysql-connectors-community/x86_64/primary_db                                                                                             | 9.8 kB  00:00:00     
(2/3): mysql-tools-community/x86_64/primary_db                                                                                                  |  25 kB  00:00:00     
(3/3): mysql56-community/x86_64/primary_db                                                                                                      | 115 kB  00:00:01     
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-server.x86_64 0:5.6.29-2.el7 will be installed
--> Processing Dependency: mysql-community-common(x86-64) = 5.6.29-2.el7 for package: mysql-community-server-5.6.29-2.el7.x86_64
--> Processing Dependency: mysql-community-client(x86-64) = 5.6.29-2.el7 for package: mysql-community-server-5.6.29-2.el7.x86_64
--> Processing Dependency: perl(DBI) for package: mysql-community-server-5.6.29-2.el7.x86_64
--> Running transaction check
---> Package mysql-community-client.x86_64 0:5.6.29-2.el7 will be installed
--> Processing Dependency: mysql-community-libs(x86-64) = 5.6.29-2.el7 for package: mysql-community-client-5.6.29-2.el7.x86_64
---> Package mysql-community-common.x86_64 0:5.6.29-2.el7 will be installed
---> Package perl-DBI.x86_64 0:1.627-4.el7 will be installed
--> Processing Dependency: perl(RPC::PlServer) >= 0.2001 for package: perl-DBI-1.627-4.el7.x86_64
--> Processing Dependency: perl(RPC::PlClient) >= 0.2000 for package: perl-DBI-1.627-4.el7.x86_64
--> Running transaction check
---> Package mariadb-libs.x86_64 1:5.5.40-1.el7_0 will be obsoleted
---> Package mysql-community-libs.x86_64 0:5.6.29-2.el7 will be obsoleting
---> Package perl-PlRPC.noarch 0:0.2020-14.el7 will be installed
--> Processing Dependency: perl(Net::Daemon) >= 0.13 for package: perl-PlRPC-0.2020-14.el7.noarch
--> Processing Dependency: perl(Net::Daemon::Test) for package: perl-PlRPC-0.2020-14.el7.noarch
--> Processing Dependency: perl(Net::Daemon::Log) for package: perl-PlRPC-0.2020-14.el7.noarch
--> Processing Dependency: perl(Compress::Zlib) for package: perl-PlRPC-0.2020-14.el7.noarch
--> Running transaction check
---> Package perl-IO-Compress.noarch 0:2.061-2.el7 will be installed
--> Processing Dependency: perl(Compress::Raw::Zlib) >= 2.061 for package: perl-IO-Compress-2.061-2.el7.noarch
--> Processing Dependency: perl(Compress::Raw::Bzip2) >= 2.061 for package: perl-IO-Compress-2.061-2.el7.noarch
---> Package perl-Net-Daemon.noarch 0:0.48-5.el7 will be installed
--> Running transaction check
---> Package perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7 will be installed
---> Package perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================================================================================================================
 Package                                         Arch                           Version                                Repository                                 Size
=======================================================================================================================================================================
Installing:
 mysql-community-libs                            x86_64                         5.6.29-2.el7                           mysql56-community                         2.0 M
     replacing  mariadb-libs.x86_64 1:5.5.40-1.el7_0
 mysql-community-server                          x86_64                         5.6.29-2.el7                           mysql56-community                          58 M
Installing for dependencies:
 mysql-community-client                          x86_64                         5.6.29-2.el7                           mysql56-community                          19 M
 mysql-community-common                          x86_64                         5.6.29-2.el7                           mysql56-community                         256 k
 perl-Compress-Raw-Bzip2                         x86_64                         2.061-3.el7                            base                                       32 k
 perl-Compress-Raw-Zlib                          x86_64                         1:2.061-4.el7                          base                                       57 k
 perl-DBI                                        x86_64                         1.627-4.el7                            base                                      802 k
 perl-IO-Compress                                noarch                         2.061-2.el7                            base                                      260 k
 perl-Net-Daemon                                 noarch                         0.48-5.el7                             base                                       51 k
 perl-PlRPC                                      noarch                         0.2020-14.el7                          base                                       36 k

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

Total download size: 80 M
Is this ok [y/d/N]: yyyyyy^H^H^H^H^[[3~
Is this ok [y/d/N]: y
Downloading packages:
warning: /var/cache/yum/x86_64/7/mysql56-community/packages/mysql-community-common-5.6.29-2.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY36 ETA 
Public key for mysql-community-common-5.6.29-2.el7.x86_64.rpm is not installed
(1/10): mysql-community-common-5.6.29-2.el7.x86_64.rpm                                                                                          | 256 kB  00:00:02     
(2/10): mysql-community-libs-5.6.29-2.el7.x86_64.rpm                                                                                            | 2.0 MB  00:00:04     
(3/10): perl-Compress-Raw-Zlib-2.061-4.el7.x86_64.rpm                                                                                           |  57 kB  00:00:00     
(4/10): perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64.rpm                                                                                          |  32 kB  00:00:00     
(5/10): perl-Net-Daemon-0.48-5.el7.noarch.rpm                                                                                                   |  51 kB  00:00:00     
(6/10): perl-PlRPC-0.2020-14.el7.noarch.rpm                                                                                                     |  36 kB  00:00:00     
(7/10): perl-IO-Compress-2.061-2.el7.noarch.rpm                                                                                                 | 260 kB  00:00:00     
(8/10): perl-DBI-1.627-4.el7.x86_64.rpm                                                                                                         | 802 kB  00:00:01     
(9/10): mysql-community-client-5.6.29-2.el7.x86_64.rpm                                                                                          |  19 MB  00:01:10     
(10/10): mysql-community-server-5.6.29-2.el7.x86_64.rpm                                                                                         |  58 MB  00:04:08     
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                  322 kB/s |  80 MB  00:04:15     
Retrieving key from file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Importing GPG key 0x5072E1F5:
 Userid     : "MySQL Release Engineering <mysql-build@oss.oracle.com>"
 Fingerprint: a4a9 4068 76fc bd3c 4567 70c8 8c71 8d3b 5072 e1f5
 Package    : mysql-community-release-el7-5.noarch (installed)
 From       : file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
  Installing : mysql-community-common-5.6.29-2.el7.x86_64                                                                                                         1/11 
  Installing : mysql-community-libs-5.6.29-2.el7.x86_64                                                                                                           2/11 
  Installing : mysql-community-client-5.6.29-2.el7.x86_64                                                                                                         3/11 
  Installing : perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64                                                                                                         4/11 
  Installing : 1:perl-Compress-Raw-Zlib-2.061-4.el7.x86_64                                                                                                        5/11 
  Installing : perl-IO-Compress-2.061-2.el7.noarch                                                                                                                6/11 
  Installing : perl-Net-Daemon-0.48-5.el7.noarch                                                                                                                  7/11 
  Installing : perl-PlRPC-0.2020-14.el7.noarch                                                                                                                    8/11 
  Installing : perl-DBI-1.627-4.el7.x86_64                                                                                                                        9/11 
  Installing : mysql-community-server-5.6.29-2.el7.x86_64                                                                                                        10/11 
  Erasing    : 1:mariadb-libs-5.5.40-1.el7_0.x86_64                                                                                                              11/11 
  Verifying  : mysql-community-common-5.6.29-2.el7.x86_64                                                                                                         1/11 
  Verifying  : mysql-community-libs-5.6.29-2.el7.x86_64                                                                                                           2/11 
  Verifying  : perl-Net-Daemon-0.48-5.el7.noarch                                                                                                                  3/11 
  Verifying  : mysql-community-client-5.6.29-2.el7.x86_64                                                                                                         4/11 
  Verifying  : mysql-community-server-5.6.29-2.el7.x86_64                                                                                                         5/11 
  Verifying  : perl-IO-Compress-2.061-2.el7.noarch                                                                                                                6/11 
  Verifying  : 1:perl-Compress-Raw-Zlib-2.061-4.el7.x86_64                                                                                                        7/11 
  Verifying  : perl-DBI-1.627-4.el7.x86_64                                                                                                                        8/11 
  Verifying  : perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64                                                                                                         9/11 
  Verifying  : perl-PlRPC-0.2020-14.el7.noarch                                                                                                                   10/11 
  Verifying  : 1:mariadb-libs-5.5.40-1.el7_0.x86_64                                                                                                              11/11 

Installed:
  mysql-community-libs.x86_64 0:5.6.29-2.el7                                        mysql-community-server.x86_64 0:5.6.29-2.el7                                       

Dependency Installed:
  mysql-community-client.x86_64 0:5.6.29-2.el7           mysql-community-common.x86_64 0:5.6.29-2.el7           perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7          
  perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7            perl-DBI.x86_64 0:1.627-4.el7                          perl-IO-Compress.noarch 0:2.061-2.el7                 
  perl-Net-Daemon.noarch 0:0.48-5.el7                    perl-PlRPC.noarch 0:0.2020-14.el7                     

Replaced:
  mariadb-libs.x86_64 1:5.5.40-1.el7_0    


在 CentOS 9 上离线安装 `ncurses-libs` RPM 包时,如果遇到类似以下错误: ``` error: Failed dependencies: ncurses-base = 5.9-14.20130511.el7_4 is needed by ncurses-libs-5.9-14.20130511.el7_4.x86_64 ``` 这表明系统中缺少该包所依赖的 `ncurses-base` 包。由于这是一个典型的 RPM 依赖关系问题,可以通过手动下载并安装所需的依赖包来解决。 ### 获取对应的依赖包 首先需要确保你已经将所有相关的 RPM 文件传输到目标系统的本地目录中。例如,对于 `ncurses-libs` 的依赖项,应同时包含: - `ncurses-base-5.9-14.20130511.el7_4.x86_64.rpm` - `ncurses-libs-5.9-14.20130511.el7_4.x86_64.rpm` 这些文件可以从 CentOS 7 的官方镜像站点获取(因为 `ncurses` 版本为 5.9 的 RPM 是基于 CentOS 7 提供的),例如从 [vault.centos.org](http://vault.centos.org/) 下载。 ### 安装顺序处理依赖关系 使用 `rpm` 命令按照正确的顺序安装 RPM 包,以确保先满足依赖项: ```bash sudo rpm -ivh ncurses-base-5.9-14.20130511.el7_4.x86_64.rpm sudo rpm -ivh ncurses-libs-5.9-14.20130511.el7_4.x86_64.rpm ``` 这样可以避免因依赖关系未满足而导致的安装失败[^3]。 ### 使用 YUM 本地仓库简化管理(可选) 为了更高效地管理多个 RPM 包及其复杂的依赖关系,建议创建一个本地 YUM 仓库。具体步骤如下: 1. 将所有 RPM 包放入一个目录,例如 `/opt/rpms/ncurses/`。 2. 使用 `createrepo` 命令生成仓库元数据: ```bash createrepo /opt/rpms/ncurses/ ``` 3. 创建一个新的 YUM 源配置文件 `/etc/yum.repos.d/local-ncurses.repo`,内容如下: ```ini [local-ncurses] name=Local NCURSES Repository baseurl=file:///opt/rpms/ncurses/ enabled=1 gpgcheck=0 ``` 4. 使用 `yum` 安装 `ncurses-libs` 及其依赖: ```bash sudo yum install ncurses-libs ``` YUM 会自动解析并安装所有必需的依赖包,大大简化了离线环境下的软件包管理流程[^1]。 ### 验证安装结果 安装完成后,可以通过以下命令验证 `ncurses-libs` 是否成功安装: ```bash rpm -q ncurses-libs ``` 如果输出类似以下信息,则表示安装成功: ``` ncurses-libs-5.9-14.20130511.el7_4.x86_64 ``` 此外,也可以尝试运行依赖 `ncurses` 库的应用程序,确认其功能正常。 ---
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值