nginx怎么卸載

本文主要介紹如何卸載編譯安裝在linuxs上的nginx

nginx怎么卸載

刪除nginx,–purge包括配置文件

sudo apt-get --purge remove nginx

自動移除全部不使用的軟件包

sudo apt-get autoremove

羅列出與nginx相關的軟件

dpkg --get-selections|grep nginx

執行結果:

stephen@stephen-OptiPlex-390:~$ dpkg --get-selections|grep nginx nginx                       install nginx-common                install nginx-core                  install

刪除查詢出與nginx有關的軟件

sudo apt-get --purge remove nginx sudo apt-get --purge remove nginx-common

這樣就可以完全卸載掉nginx包括配置文件

查看nginx正在運行的進程,如果有就kill掉

 ps -ef |grep nginx

看下nginx還有沒有啟動,一般執行完1后,nginx還是啟動著的,如下:

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

kill nginx進程

sudo kill  -9  7875 7876 7877 7879

全局查找與nginx相關的文件

sudo  find  /  -name  nginx*

依次刪除列出的所有文件

sudo rm -rf file

這樣就徹底刪除nginx了

更多Nginx相關技術文章,請訪問Nginx使用教程欄目進行學習!?

? 版權聲明
THE END
喜歡就支持一下吧
點贊14 分享