Home>Article>Operation and Maintenance> How to uninstall nginx

How to uninstall nginx

(*-*)浩
(*-*)浩 Original
2019-06-11 09:57:13 5550browse

This article mainly introduces how to uninstall nginx compiled and installed on Linuxs.

How to uninstall nginx

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 theNginx usage tutorialcolumn 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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn