Digital Sanctum

software development, technology and other square topics

Uninstalling nginx via apt-get: Stopping nginx: invoke-rc.d: initscript nginx, action “stop” failed.

with 4 comments

If you get something like the following error:

CODE:
  1. Removing nginx ...
  2. Stopping nginx: nginx.
  3. Stopping nginx: invoke-rc.d: initscript nginx, action "stop" failed.
  4. dpkg: error processing nginx (--remove):
  5.  subprocess pre-removal script returned error exit status 1
  6. Starting nginx: /usr/sbin/nginx: error while loading shared libraries: libpcre.so.3: cannot open shared object file: No such file or directory
  7. invoke-rc.d: initscript nginx, action "start" failed.
  8. dpkg: error while cleaning up:
  9.  subprocess post-installation script returned error exit status 127
  10. Errors were encountered while processing:
  11.  nginx
  12. E: Sub-process /usr/bin/dpkg returned an error code (1)

when you try to execute something like this:

CODE:
  1. 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.

Written by Shane

November 7th, 2007 at 9:05 pm

Posted in Ruby, Ubuntu

4 Responses to 'Uninstalling nginx via apt-get: Stopping nginx: invoke-rc.d: initscript nginx, action “stop” failed.'

Subscribe to comments with RSS or TrackBack to 'Uninstalling nginx via apt-get: Stopping nginx: invoke-rc.d: initscript nginx, action “stop” failed.'.

  1. Should you also clean up the /etc/init.d/nginx file?

    Michael Newman

    17 Dec 07 at 5:43 pm

  2. I was about to throw my laptop against the wall. Thank you for saving my compy.

    meekish

    4 Feb 08 at 4:05 am

  3. [...] Fortunately I found the fix to this problem in here : http://www.digitalsanctum.com/2007/11/07/uninstalling-nginx-via-apt-get-stopping-nginx-invoke-rcd-in... [...]

  4. Thanks! This was causing me to be unable to upgrade my ruby installation.

    CLZ

    26 Jun 08 at 5:24 pm

Leave a Reply