Hi,
I’ve changed from nginx to stunnel for my webserver.. while issuing “apt-get remove nginx”, i’ve got these error :
Removing nginx …
Stopping nginx: invoke-rc.d: initscript nginx, action “stop” failed.
dpkg: error processing nginx (–remove):
subprocess pre-removal script returned error exit status 1
Errors were encountered while processing:
nginx
E: Sub-process /usr/bin/dpkg returned an error code (1)
to handle this, simply edited nginx script :
sudo nano /etc/init.d/nginx
and add ‘exit 0′ like below, after that save it :
#! /bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon
### END INIT INFOPATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
#add exit 0 below:
exit 0
DAEMON=/usr/sbin/nginx
Then, issue :
sudo apt-get remove nginx -yf
This will enable us to uninstall it :
The following packages will be REMOVED:
nginx
0 upgraded, 0 newly installed, 1 to remove and 73 not upgraded.
After this operation, 676kB disk space will be freed.
(Reading database … 19412 files and directories currently installed.)
Removing nginx …
source : http://www.peterbe.com/plog/how-to-uninstall-nginx-with-apt
: http://www.digitalsanctum.com/2007/11/07/uninstalling-nginx-via-apt-get-stopping-nginx-invoke-rcd-initscript-nginx-action-stop-failed/
salawank is Digg proof thanks to caching by WP Super Cache