Sometimes in order to install the latest version of the Nginx, do not want the system with the old version of Nginx trouble, you need to remove it.
Many times the machine room to configure the machines have installed their own nginx, the version is very old, running up already accounted for 80 ports, very annoying.
The following method tells you how to clean delete http://www.aliyun.com/zixun/aggregation/33836.html ">debian Linux system with Nginx."
Be careful to back up/etc/nginx/nginx.conf files first
cp/etc/nginx/~/-R
Apt Remove–purge nginx
If the error is correct, edit
/var/lib/dpkg/info/nginx.prerm
Comment out of the line with INVOKE-RC.D abound gives the stop statement for Nginx
If there is no deletion, delete:
sudo rm-rf/etc/nginx/
sudo rm-rf/usr/sbin/nginx
sudo rm/usr/share/man/man1/nginx.1.gz
sudo apt remove nginx*
Transfer from Nginx Chinese web