前端之家收集整理的这篇文章主要介绍了
ubuntu14.04彻底删除nginx,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
http://blog.csdn.net/u010571844/article/details/50819704
1.先执行一下命令:
sudo apt-
get
1.2 自动移除全部不使用的软件包
1@H_403_13@
2@H_403_13@
sudo apt-get autoremove
1.3 罗列出与Nginx相关的软件
1@H_403_13@
dpkg --get-selections|grep Nginx
1@H_403_13@
2@H_403_13@
3@H_403_13@
4@H_403_13@
5@H_403_13@
6@H_403_13@
执行1.3的结果:
stephen@stephen-OptiPlex-390:~$ dpkg --get-selections|grep Nginx
Nginx install
Nginx-common install
Nginx-core install
1@H_403_13@
2@H_403_13@
3@H_403_13@
sudo apt---purge remove Nginx
sudo apt---purge remove Nginx-common
sudo apt---purge remove Nginx-core
这样就可以完全卸载掉Nginx包括配置文件
2.查看Nginx正在运行的进程,如果有就kill掉
1@H_403_13@
ps -ef |grep Nginx
看下Nginx还有没有启动,一般执行完1后,Nginx还是启动着的,如下:
1@H_403_13@
2@H_403_13@
3@H_403_13@
4@H_403_13@
5@H_403_13@
6@H_403_13@
7@H_403_13@
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
1@H_403_13@
sudo kill -9 7875 7876 7877 7879
sudo find / -name Nginx*
5.依依删除4列出的所有文件
sudo rm -rf file
这样就彻底删除Nginx了
6. 再次重装
sudo apt-get update
sudo apt-get install Nginx