使用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或者源碼包進行安裝咯