rpm卸载包遭遇 specifies multiple packages 错误

Posted 长城之上是千亿的星空,星空之上是不灭的守望。

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了rpm卸载包遭遇 specifies multiple packages 错误相关的知识,希望对你有一定的参考价值。

使用 rpm删除软件时报错如下:

[[email protected]]# rpm -qa |grep -i mysql
mysql-devel-5.0.95-5.el5_9
mysql-devel-5.0.95-5.el5_9
MySQL-shared-5.5.34-1.rhel5
mysql-5.0.95-5.el5_9
mysql-server-5.0.95-5.el5_9
MySQL-shared-compat-5.5.34-1.rhel5
perl-DBD-MySQL-3.0007-2.el5
mysql-5.0.95-5.el5_9

然后执行删除:

[[email protected] lidan]# rpm -e mysql-5.0.95-5.el5_9
error: "mysql-5.0.95-5.el5_9" specifies multiple packages

上面确实两个包,故报这个问题很正常。

man rpm 发现有一个参数 --allmatches



       --allmatches
              Remove all versions of the package which match PACKAGE_NAME. Normally an error is issued if PACKAGE_NAME
              matches multiple packages.

然后执行

[[email protected] lidan]# rpm -e --allmatches   mysql-5.0.95-5.el5_9
error: Failed dependencies:
        mysql = 5.0.95-5.el5_9 is needed by (installed) mysql-devel-5.0.95-5.el5_9.x86_64
        mysql = 5.0.95-5.el5_9 is needed by (installed) mysql-devel-5.0.95-5.el5_9.i386
        libmysqlclient.so.15 is needed by (installed) mysql-devel-5.0.95-5.el5_9.i386
        libmysqlclient_r.so.15 is needed by (installed) mysql-devel-5.0.95-5.el5_9.i386

还有依赖再去依赖

rpm -e --allmatches --nodeps  mysql-5.0.95-5.el5_9

以上是关于rpm卸载包遭遇 specifies multiple packages 错误的主要内容,如果未能解决你的问题,请参考以下文章

Linux rpm -e卸载命令e是哪个单词

CentOS7下rpm命令详解,rpm包的安装与卸载

如何卸载rpm包

RPM命令详解(安装升级卸载)

RPM-卸载RPM包

安装和卸载软件包