centos下删除用yum安装的软件

yum安装软件包,方便简单.但在这个过程中,那些文件和目录都到哪里去了呢?到处都是呀!要维护这些文件,很麻烦的.前两天,我用源码安装mysql-proxy,在编译过程中,老出错,我就依提示安装mysql, 为了尽快完事,我用了yum install mysql.现在我打算重新安装mysql,因此需要把yum方式安装的mysql删除.

用rpm工具吧,不行呢.挨个删除文件,更不可行,因为我不知道究竟安装了哪些文件,都存放在哪些位置.怎么办?还好,yum自己可以完成这个工作.

现在我们来看一下yum的参数:

[root@test1 ~]# yum
You need to give some command
usage: yum [options] < grouplist, localinstall, groupinfo, localupdate, resolvedep, erase, deplist, groupremove, makecache, upgrade, provides, shell, install, whatprovides, groupinstall, update, repolist, groupupdate, info, search, check-update, list, remove, clean, grouperase >

其中remove就是删除命令.好了,我们来执行命令 yum remove mysql ,其输出如下:

[root@test1 ~]# yum remove mysql
Setting up Remove Process
base                      100% |=========================| 1.1 kB    00:00    
updates                   100% |=========================|  951 B    00:00    
addons                    100% |=========================|  951 B    00:00    
extras                    100% |=========================| 1.1 kB    00:00    
Resolving Dependencies
–> Running transaction check
—> Package mysql.i386 0:5.0.45-7.el5 set to be erased
–> Processing Dependency: libmysqlclient.so.15 for package: mysql-devel
–> Processing Dependency: libmysqlclient_r.so.15 for package: mysql-devel
–> Processing Dependency: mysql = 5.0.45-7.el5 for package: mysql-devel
–> Running transaction check
—> Package mysql-devel.i386 0:5.0.45-7.el5 set to be erased
–> Finished Dependency Resolution

Dependencies Resolved

=============================================================================
Package                 Arch       Version          Repository        Size
=============================================================================
Removing:
mysql                   i386       5.0.45-7.el5     installed         7.3 M
Removing for dependencies:
mysql-devel             i386       5.0.45-7.el5     installed         5.6 M

Transaction Summary
=============================================================================
Install      0 Package(s)        
Update       0 Package(s)        
Remove       2 Package(s)        

Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Erasing   : mysql-devel                  ######################### [1/2]
  Erasing   : mysql                        ######################### [2/2]

Removed: mysql.i386 0:5.0.45-7.el5
Dependency Removed: mysql-devel.i386 0:5.0.45-7.el5
Complete!

看,很容易就完成了.再来验证一下: 执行命令mysql,其结果为:

[root@test1 ~]# mysql
-bash: mysql: command not found

果然删除了!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值