3

I want to uninstall RabbitMQ on Ubuntu 10.04, and issued the following command:

sudo apt-get --purge autoremove rabbitmq-server

which uninstalls all its dependencies such erlang libraries, but failed to remove rabbitmq-server itself.

When I repeat the command above, I get:

(Reading database ... 26297 files and directories currently installed.)
Removing rabbitmq-server ...
 * Stopping message broker rabbitmq-server                                              
 * message broker already stopped
                                                                                [ OK ]
invoke-rc.d: initscript rabbitmq-server, action "stop" failed.
dpkg: error processing rabbitmq-server (--purge):
 subprocess installed pre-removal script returned error exit status 3
 * Starting message broker rabbitmq-server                                              
 * FAILED - check /var/log/rabbitmq/startup_\{log, _err\}
                                                                                [fail]
invoke-rc.d: initscript rabbitmq-server, action "start" failed.
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 rabbitmq-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

What can I do next to remove the package completely? Thanks!

MLister
  • 211
  • 1
  • 5
  • 12
  • http://serverfault.com/questions/225795/error-when-installing-rabbitmq-server-on-ubuntu-10-10 – quanta Sep 20 '12 at 16:38
  • @quanta, that question is about errors during installation, not errors when **uninstalling** RabbitMQ. – MLister Sep 20 '12 at 17:09

1 Answers1

6

I'd go this way:

Try removing it without further options: sudo apt-get remove rabbitmq-server

See if that works, if not, probably a new error message arises.

If the deinstallation script expects the server to be running, it might help to start it before running the command. If it can't be started any more, I'd try to hack the script to return an exit code of 0 to trick the script.

After something worked, I'd do the --purge option and then autoremove.

exic
  • 579
  • 4
  • 8
  • running `sudo apt-get remove rabbitmq-server` gives the exactly same error message. I agree that uninstallation script probably expects the server to be running, but the problem is that all its dependencies have been removed, which is exactly why it cannot be started. – MLister Sep 20 '12 at 17:12
  • So what does editing `/etc/init.d/rabbitmq-server` and adding `exit 0` after the first line do? Does it still complain? – exic Sep 21 '12 at 09:20
  • probably should try that first, but I just force deleted the package, and manually cleared up any rabbit-mq related files. – MLister Sep 21 '12 at 17:07
  • I guess that's valid too :-) Doesn't purge work after force deleting it? – exic Sep 21 '12 at 20:10