如何在centos下卸载干净nginx

比如为了测试,我们使用yum新装了nginx,那么如何卸载的时候更干净一些呢?

我们先使用history来查看刚刚执行过的命令

yum history

然后会出现如下所示

[root@localhost ~]# yum history
已加载插件:fastestmirror
ID     | 登录用户                 | 日期和时间       | 操作           | 变更数 
-------------------------------------------------------------------------------
     5 | root <root>              | 2021-03-16 11:22 | I, U           |   24   
     4 | root <root>              | 2021-03-16 11:21 | Install        |    1   
     3 | root <root>              | 2019-01-23 14:28 | I, U           |   46   
     2 | root <root>              | 2019-01-23 14:27 | Install        |    1   
     1 | 系统 <>                | 2019-01-23 22:07 | Install        |  313   
history list

我们可以根据时间和变更书来判断,刚刚的操作,可以看到,ID为5是我刚刚安装的nginx,nginx所变更的文件数为25,那么我们可以执行如下命令撤回nginx安装

后面的数字:5,为ID

yum history undo 5

这样就可以把Nginx卸载干净了

原文地址:https://www.cnblogs.com/maohedashu/p/14542584.html