How to uninstall nginx

(*-*)浩
Release: 2019-06-18 11:10:09
Original
5634 people have browsed it

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
Copy after login

Automatically remove all unused software packages

sudo apt-get autoremove
Copy after login

List the software related to nginx

dpkg --get-selections|grep nginx
Copy after login

Execution result:

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

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
Copy after login

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
Copy after login

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
Copy after login

kill nginx process

sudo kill  -9  7875 7876 7877 7879
Copy after login

Globally search for files related to nginx

sudo  find  /  -name  nginx*
Copy after login

Delete all files listed in sequence

sudo rm -rf file
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!