Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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\}
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:
E: Sub-process /usr/bin/dpkg returned an error code (1)

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

share|improve this question… – 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
up vote 3 down vote accepted

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.

share|improve this answer
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 9: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
yes it does. thanks for the pointers anyway – MLister Sep 21 '12 at 20:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.