1.先執(zhí)行卸載的命令:
sudo apt-get --purge remove nginx
sudo apt-get autoremove
dpkg --get-selections|grep nginx
羅列出與nginx相關的軟件, nginx-common deinstall?
然后
sudo apt-get --purge remove nginx-common
這樣就可以完全卸載掉nginx包括配置文件
2.ps -ef |grep nginx?看下nginx還有沒有啟動,一般執(zhí)行完1后,nginx還是啟動著的,如下:
root@ubuntu:/$ ps -ef |grep nginx
root?????4061? 2418? 0 Mar11 ???????? 00:00:00 nginx: master processsbin/nginx
nobody???4062? 4061? 0 Mar11 ???????? 00:00:00 nginx: worker process
bkxmgx??15487? 4229? 0 01:13 pts/0??? 00:00:00 grep --color=auto nginx
3.kill?? nginx進程
sudo kill?-9? 4061? 4062
4.sudo? find? /?-name? nginx*
/usr/local/src/nginx-1.7.9
/usr/local/src/nginx-1.7.9/objs/src/core/nginx.o
/usr/local/nginx/logs/nginx.pid
/usr/local/nginx/conf/nginx.conf.default
/usr/local/nginx/conf/nginx.conf
5.依依刪除4列出的所有文件
sudo?rm? -r? /usr/local/src/nginx-1.7.9
sudo?rm? -r? /usr/local/src/nginx-1.7.9/objs/src/core/nginx.o
從而徹底刪除nginx