使用rpm卸载
rpm -e
–nodeps (如果提示软件包被install了,增加在参数)
使用yum卸载
yum remove (会把一些依赖的包一起删除)
配置举例
卸载openssh
查看openssh已经安装的rpm包
[root@localhost ~]# rpm -qa | grep openssh
openssh-clients-7.4p1-13.el7_4.x86_64
openssh-7.4p1-13.el7_4.x86_64
openssh-server-7.4p1-13.el7_4.x86_64
尝试使用rpm卸载openssh-clients-7.4p1-13.el7_4.x86_64
[root@localhost ~]# rpm -e --nodeps openssh-clients-7.4p1-13.el7_4.x86_64
尝试使用yum卸载openssh-7.4p1-13.el7_4.x86_64,卸载后发现openssh-server-7.4p1-13.el7_4.x86_64也被删除了
[root@localhost ~]# yum remove openssh-7.4p1-13.el7_4.x86_64
删除后查看在查看openssh是否删干净了
[root@localhost ~]# rpm -qa | grep openssh
卸载后大家就可以通过yum,rpm或者源码包进行安装咯