1. 程式人生 > 實用技巧 >linux 安裝rpm包時遇到error:Failed dependencies解法方法

linux 安裝rpm包時遇到error:Failed dependencies解法方法

一、安裝MySQL
[[email protected] src]# rpm -ivh mysql57-community-release-el7-8.noarch.rpm
error: Failed dependencies:
mysql57-community-release conflicts with (installed) mysql80-community-release-el7-1.noarch

在安裝包後面加兩個引數,如 :
[email protected] src]# rpm -ivh http://repo.mysql.com/yum/mysql-5.6-community/el/6/x86_64/mysql-community-release-el6-5.noarch.rpm

--nodeps --force
Retrieving http://repo.mysql.com/yum/mysql-5.6-community/el/6/x86_64/mysql-community-release-el6-5.noarch.rpm
Preparing… ################################# [100%]
Updating / installing…
1:mysql-community-release-el6-5 warning: /etc/yum.repos.d/mysql-community.repo created as /etc/yum.repos.d/mysql-community.repo.rpmnew
################################# [100%]

[email protected] src]# rpm -ivh http://repo.mysql.com/yum/mysql-5.6-community/el/6/x86_64/mysql-community-release-el6-5.noarch.rpm --nodeps --force
Retrieving http://repo.mysql.com/yum/mysql-5.6-community/el/6/x86_64/mysql-community-release-el6-5.noarch.rpm
Preparing… ################################# [100%]

Updating / installing…
1:mysql-community-release-el6-5 warning: /etc/yum.repos.d/mysql-community.repo created as /etc/yum.repos.d/mysql-community.repo.rpmnew
################################# [100%]
在這裡插入圖片描述

二、安裝rpm包時經常會遇到
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID*****
這是由於yum安裝了舊版本的GPG keys造成的,解決辦法就是

rpm --import /etc/pki/rpm-gpg/RPM*

三、執行解除安裝命令

rpm –e ImageMagick-6.2.8.0-4.el5_1.1

error: “ImageMagick-6.2.8.0-4.el5_1.1” specifies multiple packages

rpm –e ImageMagick-6.2.8.0-4.el5_1.1 --nodeps

error: “ImageMagick-6.2.8.0-4.el5_1.1” specifies multiple packages

如果解除安裝的時候提示與其他包存在依賴關係,可以一個個解除安裝提示的程式,也可以使用–nodeps 引數,不考慮依賴關係而直接解除安裝。

rpm -e ImageMagick-6.2.8.0-4.el5_1.1 --allmatches --nodeps

四、 centos下mysql rpm包安裝報錯 NOKEY的問題

rpm -ivh mysql-community-server-5.7.10-1.el5.i686.rpm
warning: mysql-community-server-5.7.10-1.el5.i686.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
error: Failed dependencies:
解決辦法:
rpm -ivh mysql-community-server-5.7.10-1.el5.i686.rpm --nodeps --force

五、安裝Samba伺服器時候使用CD掛載安裝的,結果遇到如下報錯
not an rpm package (or package manifest):Input/output error //報錯資訊
解決方法:重新下載新的RPM安裝包,原因是因為RPM包有損壞,多發生在掛在CD的情況下
下載RPM包地址 http://rpm.pbone.net/