This article mainly introduces how to uninstall nginx compiled and installed on Linuxs.
Delete nginx, –purge includes the configuration file
sudo apt-get --purge remove nginx
Automatically remove all unused software packages
sudo apt-get autoremove
List the software related to nginx
dpkg --get-selections|grep nginx
Execution result:
stephen@stephen-OptiPlex-390:~$ dpkg --get-selections|grep nginx nginx install nginx-common install nginx-core install
Delete the query to find out the software related to nginx Relevant software
sudo apt-get --purge remove nginx sudo apt-get --purge remove nginx-common
This way you can completely uninstall nginx including the configuration file
Check the running process of nginx and kill it if there is one
ps -ef |grep nginx
Check whether nginx is still started. Generally, after executing 1, nginx is still started, as follows:
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 process
sudo kill -9 7875 7876 7877 7879
Globally search for files related to nginx
sudo find / -name nginx*
Delete all files listed in sequence
sudo rm -rf file
This will completely delete nginx
For more Nginx related technical articles, please visit the Nginx usage tutorial column to learn!
The above is the detailed content of How to uninstall nginx. For more information, please follow other related articles on the PHP Chinese website!