Uninstalling nginx via apt-get: Stopping nginx: invoke-rc.d: initscript nginx, action "stop" failed.
Published: 07 Nov 2007
If you get something like the following error:
Removing nginx ...
Stopping nginx: 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
Starting nginx: /usr/sbin/nginx: error while loading shared libraries: libpcre.so.3: cannot open shared object file: No such file or directory
invoke-rc.d: initscript nginx, action "start" failed.
dpkg: error while cleaning up:
subprocess post-installation script returned error exit status 127
Errors were encountered while processing:
nginx
E: Sub-process /usr/bin/dpkg returned an error code (1)
when you try to execute something like this:
sudo apt-get remove nginx -yf
Then you need to add exit 0
to the second line of your /etc/init.d/nginx
file.
Pure hackery but it works.