http://blog.csdn.net/u010571844/article/details/50819704
1.先执行一下命令:
1.1 删除nginx,–purge包括配置文件
sudo apt-
get
1.2 自动移除全部不使用的软件包
1
2
sudo apt-get autoremove
1.3 罗列出与nginx相关的软件
1
dpkg --
get-selections|grep nginx
1
2
3
4
5
6
执行
1.3的结果:
stephen@stephen
-OptiPlex-390:~$ dpkg
--get
-selections|grep nginx
nginx install
nginx
-common install
nginx
-core install
1.4 删除1.3查询出与nginx有关的软件
1
2
3
sudo apt-
--purge remove nginx
sudo apt-
--purge remove nginx-common
sudo apt-
--purge remove nginx-core
这样就可以完全卸载掉nginx包括配置文件
2.查看nginx正在运行的进程,如果有就kill掉
1
ps -ef
|grep nginx
看下nginx还有没有启动,一般执行完1后,nginx还是启动着的,如下:
1
2
3
4
5
6
7
stephen@stephen-
OptiPlex-
390:~$ ps -ef |grep nginx
root 7875 2317 0 15:
02 ?
00:
00 nginx: master process /usr/sbin/nginx
www-
data 7876 7875 0 15:02 ? 00:00:00 nginx: worker process
www-
data 7877 7875 0 15:02 ? 00:00:00 nginx: worker process
www-
data 7878 7875 0 15:02 ? 00:00:00 nginx: worker process
www-
data 7879 7875 0 15:02 ? 00:00:00 nginx: worker process
stephen 8321 3510 20 pts/
0 00 grep
3.kill nginx进程
1
sudo kill -
9 7875 7876 7877 7879
4.全局查找与nginx相关的文件
sudo find / -name nginx*
5.依依删除4列出的所有文件
sudo rm -rf file
这样就彻底删除nginx了
6. 再次重装
sudo apt-get update
sudo apt-get install nginx
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。