Ubuntu16.04 completely delete nginx + php and ubuntu16.04nginx

Source: Internet
Author: User

Ubuntu16.04 completely delete nginx + php and ubuntu16.04nginx
1.1 Delete nginx,-purge includes configuration files

Sudo apt-get -- purge remove nginx

1.2 automatically remove all unused software packages

Sudo apt-get autoremove

1.3 list nginx-related software
dpkg --get-selections|grep nginx
Execute the result of 1.3: stephen @ stephen-OptiPlex-390 :~ $ Dpkg -- get-selections | grep nginxnginx installnginx-common installnginx-core install
1.4 Delete 1.3 query nginx-related software
sudo apt-get --purge remove nginxsudo apt-get --purge remove nginx-commonsudo apt-get --purge remove nginx-core

In this way, you can completely uninstall nginx, including the configuration file.

2. Check the nginx running process and kill it if any.
ps -ef |grep nginx

Check whether nginx is started. Generally, nginx is started after 1 is executed, as shown below:

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 nginx
Kill nginx Process
sudo kill  -9  7875 7876 7877 7879
4. Globally search for nginx-Related Files
sudo  find  /  -name  nginx*
5. Delete all objects listed in 4 by Yiyi
sudo rm -rf file

In this way, nginx is permanently deleted.

6. reinstall again
sudo apt-get updatesudo apt-get install nginx

3. Uninstall and delete php sudo apt-get-purge remove libapache2-mod-php5 php5 php5-gd php5-mysqlsudo apt-get autoremove php5 Delete Association, sudo find/etc-name "* php *" | xargs rm-rf clear residual information dpkg-l | grep ^ rc | awk '{print $2}' | sudo xargs dpkg- P use dpkg-l | grep php and dpkg-l | grep php5 check, clean and uninstall without returning Delete php permanentlySudo apt-get-purge remove libapache2-mod-php5 php5 php5-gd php5-mysql

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.