码迷,mamicode.com
首页 > 其他好文 > 详细

如何卸载rpm包

时间:2016-03-11 14:00:38      阅读:146      评论:0      收藏:0      [点我收藏+]

标签:

首先通过  rpm -q <关键字> 可以查询到rpm包的名字

然后 调用 rpm -e <包的名字> 删除特定rpm包

如果遇到依赖,无法删除,使用 rpm -e --nodeps <包的名字> 不检查依赖,直接删除rpm包

如果恰好有多个包叫同样的名字,使用 rpm -e --allmatches --nodeps <包的名字> 删除所有相同名字的包, 并忽略依赖

删除 mysql5.6示例

[wuliang@localhost Downloads]$ rpm -qa|grep mysql
mysql-community-client-5.6.27-2.el6.x86_64
mysql-community-libs-5.6.27-2.el6.x86_64
php-mysql-5.3.3-46.el6_6.x86_64
mysql-community-common-5.6.27-2.el6.x86_64
mysql-community-libs-compat-5.6.27-2.el6.x86_64
mysql-community-server-5.6.27-2.el6.x86_64
mysql-community-release-el6-5.noarch
[wuliang@localhost Downloads]$ yum -y remove mysql

[root@localhost Downloads]# rpm -qa|grep mysql
mysql-community-libs-5.6.27-2.el6.x86_64
php-mysql-5.3.3-46.el6_6.x86_64
mysql-community-common-5.6.27-2.el6.x86_64
mysql-community-libs-compat-5.6.27-2.el6.x86_64
mysql-community-release-el6-5.noarch

[root@localhost Downloads]# rpm -e mysql-community-libs-5.6.27-2.el6.x86_64
error: Failed dependencies:
    mysql-community-libs(x86-64) = 5.6.27-2.el6 is needed by (installed) mysql-community-libs-compat-5.6.27-2.el6.x86_64
[root@localhost Downloads]# rpm -e mysql-community-libs-compat-5.6.27-2.el6.x86_64
error: Failed dependencies:
    libmysqlclient.so.16()(64bit) is needed by (installed) php-mysql-5.3.3-46.el6_6.x86_64
    libmysqlclient.so.16(libmysqlclient_16)(64bit) is needed by (installed) php-mysql-5.3.3-46.el6_6.x86_64
[root@localhost Downloads]# rpm -e php-mysql-5.3.3-46.el6_6.x86_64
[root@localhost Downloads]# rpm -e mysql-community-libs-compat-5.6.27-2.el6.x86_64
[root@localhost Downloads]# rpm -e mysql-community-libs-5.6.27-2.el6.x86_64
[root@localhost Downloads]# rpm -q|grep mysql
rpm: no arguments given for query
[root@localhost Downloads]# rpm -qa|grep mysql
mysql-community-common-5.6.27-2.el6.x86_64
mysql-community-release-el6-5.noarch
[root@localhost Downloads]# rpm -e mysql-community-release-el6-5.noarch
[root@localhost Downloads]# rpm -e mysql-community-common-5.6.27-2.el6.x86_64
[root@localhost Downloads]# rpm -qa|grep mysql
没有了  说明删除干净

 

如何卸载rpm包

标签:

原文地址:http://www.cnblogs.com/wuling129/p/5265066.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!