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 ~]