1 | sudo apt-get --purge remove nginx |
1 | sudo apt-get autoremove |
1 | dpkg --get-selections|grep nginx |
1 2 3 4 5 | 执行1.3的结果:stephen@stephen-OptiPlex-390:~$ dpkg --get-selections|grep nginxnginx installnginx-common installnginx-core install |
1 2 3 | sudo apt-get --purge remove nginxsudo apt-get --purge remove nginx-commonsudo apt-get --purge remove nginx-core |
这样就可以完全卸载掉nginx包括配置文件
1 | ps -ef |grep nginx |
看下nginx还有没有启动,一般执行完1后,nginx还是启动着的,如下:
1 2 3 4 5 6 7 | stephen@stephen-OptiPlex-390:~$ ps -ef |grep nginxroot 7875 2317 0 15:02 ? 00:00:00 nginx: master process /usr/sbin/nginxwww-data 7876 7875 0 15:02 ? 00:00:00 nginx: worker processwww-data 7877 7875 0 15:02 ? 00:00:00 nginx: worker processwww-data 7878 7875 0 15:02 ? 00:00:00 nginx: worker processwww-data 7879 7875 0 15:02 ? 00:00:00 nginx: worker processstephen 8321 3510 0 15:20 pts/0 00:00:00 grep --color=auto nginx |
1 | sudo kill -9 7875 7876 7877 7879 |
1 | sudo find / -name nginx* |
1 | sudo rm -rf file |
1 2 | sudo apt-get updatesudo apt-get install nginx |