nginx

Uninstall nginx failed

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 INFO

PATH=/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/

By salawank on January 13, 2010 | Uncategorized | 1 comment
Tags:

8 visitors online now
8 guests, 0 members
Max visitors today: 8 at 11:14 am GMT-8
This month: 8 at 09-04-2010 04:05 pm GMT-8
This year: 21 at 03-24-2010 06:49 pm GMT-8
All time: 43 at 10-20-2009 08:17 am GMT-8

salawank is Digg proof thanks to caching by WP Super Cache