sudo apt-get --purge remove nginx
sudo apt-get autoremove
dpkg --get-selections|grep nginx
執行1.3的結果: stephen@stephen-OptiPlex-390:~$ dpkg --get-selections|grep nginx nginx install nginx-common install nginx-core install
sudo apt-get --purge remove nginx sudo apt-get --purge remove nginx-common sudo apt-get --purge remove nginx-core
這樣就能夠徹底卸載掉nginx包括配置文件nginx
ps -ef |grep nginx
看下nginx還有沒有啓動,通常執行完1後,nginx仍是啓動着的,以下:bash
stephen@stephen-OptiPlex-390:~$ ps -ef |grep nginx root 7875 2317 0 15:02 ? 00: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 0 15:20 pts/0 00:00:00 grep --color=auto nginx
sudo kill -9 7875 7876 7877 7879
sudo find / -name nginx*
sudo rm -rf file
sudo apt-get update sudo apt-get install nginx