卸載 刪除 nginx
1.刪除nginx,–purge包括配置文件
2.自動移除全部不使用的軟件包
3.羅列出與nginx相關的軟件
執行結果:
4.刪除3.查詢出與nginx有關的軟件
這樣就可以完全卸載掉nginx包括配置文件
5.查看nginx正在運行的進程,如果有就kill掉
看下nginx還有沒有啓動,一般執行完1後,nginx還是啓動着的,如下:
6.kill nginx進程
7.全局查找與nginx相關的文件
8.依依刪除4列出的所有文件
這樣就徹底刪除nginx了
sudo apt-get --purge remove nginx1
sudo apt-get autoremove1
dpkg --get-selections|grep nginx1
執行結果:
stephen@stephen-OptiPlex-390:~$ dpkg --get-selections|grep nginx nginx install nginx-common install nginx-core install12345
sudo apt-get --purge remove nginxsudo apt-get --purge remove nginx-commonsudo apt-get --purge remove nginx-core123
這樣就可以完全卸載掉nginx包括配置文件
ps -ef |grep nginx1
看下nginx還有沒有啓動,一般執行完1後,nginx還是啓動着的,如下:
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 nginx1234567
sudo kill -9 7875 7876 7877 78791
sudo find / -name nginx*1
sudo rm -rf file1
這樣就徹底刪除nginx了