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 permanently
Sudo apt-get-purge remove libapache2-mod-php5 php5 php5-gd php5-mysql