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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM