centos卸载软件及其依赖方法

以卸载git为例:
(1)查看要卸载软件的ID

[root@cli-1 ~]
# yum history list git
Loaded plugins: fastestmirror
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
ID     | Command line             | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------
    19 | install git-all          | 2019-01-10 22:52 | I, U           |   95   
history list
[root@cli-1 ~]

(2)检查ID是否正确

[root@cli-1 ~]
# yum history list 19
Loaded plugins: fastestmirror
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
ID     | Command line             | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------
    19 | install git-all          | 2019-01-10 22:52 | I, U           |   95   
Warning: RPMDB altered outside of yum.
history list
[root@cli-1 ~]

(3)卸载软件及其依赖

[root@cli-1 ~]
# yum history undo 19
Loaded plugins: fastestmirror
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
Undoing transaction 19, from Thu Jan 10 22:52:00 2019
...
Removed:
  adwaita-cursor-theme.noarch 0:3.28.0-1.el7   adwaita-icon-theme.noarch 0:3.28.0-1.el7  apr.x86_64 0:1.4.8-3.el7_4.1                 
  apr-util.x86_64 0:1.5.2-6.el7                at-spi2-atk.x86_64 0:2.26.2-1.el7         at-spi2-core.x86_64 0:2.28.0-1.el7           
  cairo-gobject.x86_64 0:1.15.12-3.el7         colord-libs.x86_64 0:1.3.4-1.el7          cvs.x86_64 0:1.11.23-35.el7                  
  cvsps.x86_64 0:2.2-0.14.b1.el7               dconf.x86_64 0:0.28.0-4.el7               dejavu-fonts-common.noarch 0:2.33-6.el7      
  dejavu-sans-fonts.noarch 0:2.33-6.el7        emacs-common.x86_64 1:24.3-22.el7         emacs-git.noarch 0:1.8.3.1-20.el7       
  ... 

(4)检查是否卸载成功

[root@cli-1 ~]
# git
-bash: /usr/bin/git: No such file or directory
[root@cli-1 ~]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值