Linux删除Nginx有残留怎么办?

前言:玩docker的时候,不小心在linux系统里面装了nginx,然后docker里面也装了nginx

使用nginx时有些混淆,然后

一、docker删除nginx步骤:

1.1、找到容器id

[root@VM-4-7-centos ~]# docker ps -a
CONTAINER ID   IMAGE         COMMAND                  CREATED          STATUS                      PORTS                               NAMES
1d526cafca50   nginx         "/docker-entrypoint.…"   54 minutes ago   Up 19 minutes               0.0.0.0:89->80/tcp, :::89->80/tcp   mynignx

1.2、执行删除命令

docker rm -f 1d526cafca50

二、linux删除nginx步骤

2.1、执行删除命令

[root@VM-4-7-centos ~]# yum remove nginx

三、确认nginx是否删除干净

whereis nginx

3.1发现还有残留

[root@VM-4-7-centos ~]# whereis nginx
nginx: /usr/sbin/nginx /usr/lib64/nginx /etc/nginx /usr/share/nginx /usr/share/man/man3/nginx.3pm.gz /usr/share/man/man8/nginx.8.gz

3.2找到nginx

find -name nginx

这边有个小坑(执行查找语句时需要进入根目录查找)

#home目录
[root@VM-4-7-centos ~]#
#根目录
[root@VM-4-7-centos /]#

3.3查出nginx目录如下

[root@VM-4-7-centos /]# find -name nginx
./etc/logrotate.d/nginx
./etc/nginx
./usr/share/nginx
./usr/lib64/nginx
./usr/sbin/nginx
./var/log/nginx
./var/lib/docker/overlay2/921516d73040cfd2a2b225ebf6ac689f0a1a653688a4e891efcda4de69b88963/diff/etc/default/nginx
./var/lib/docker/overlay2/921516d73040cfd2a2b225ebf6ac689f0a1a653688a4e891efcda4de69b88963/diff/etc/logrotate.d/nginx
./var/lib/docker/overlay2/921516d73040cfd2a2b225ebf6ac689f0a1a653688a4e891efcda4de69b88963/diff/etc/init.d/nginx
./var/lib/docker/overlay2/921516d73040cfd2a2b225ebf6ac689f0a1a653688a4e891efcda4de69b88963/diff/etc/nginx
./var/lib/docker/overlay2/921516d73040cfd2a2b225ebf6ac689f0a1a653688a4e891efcda4de69b88963/diff/usr/lib/nginx
./var/lib/docker/overlay2/921516d73040cfd2a2b225ebf6ac689f0a1a653688a4e891efcda4de69b88963/diff/usr/share/doc/nginx
./var/lib/docker/overlay2/921516d73040cfd2a2b225ebf6ac689f0a1a653688a4e891efcda4de69b88963/diff/usr/share/nginx
./var/lib/docker/overlay2/921516d73040cfd2a2b225ebf6ac689f0a1a653688a4e891efcda4de69b88963/diff/usr/sbin/nginx
./var/lib/docker/overlay2/921516d73040cfd2a2b225ebf6ac689f0a1a653688a4e891efcda4de69b88963/diff/var/log/nginx
./var/lib/docker/overlay2/921516d73040cfd2a2b225ebf6ac689f0a1a653688a4e891efcda4de69b88963/diff/var/cache/nginx
./var/lib/nginx

四、删除目录

[root@VM-4-7-centos /]# rm -rf /etc/logrotate.d/nginx

删除完成再用

find -name nginx 查一遍

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值