29

Is there any simple way to install RabbitMQ for Ubuntu? I did the the following:

Add the following line to /etc/apt/sources.list:

deb http://www.rabbitmq.com/debian/ testing main  

then install with apt-get:

$ sudo apt-get install rabbitmq-server

But I get the following error every time:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.

Since you only requested a single operation it is extremely likely that
the package is simply not installable and a bug report against
that package should be filed.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 rabbitmq-server: Depends: erlang-nox (>= 1:12.b.3) but 1:11.b.5dfsg-11 is to be     installed
 E: Broken packages

How am I supposed to install dependencies and to control the version of erlang-nox since it is installed already?

David Cain
  • 16,484
  • 14
  • 65
  • 75
Eki Eqbal
  • 5,779
  • 9
  • 47
  • 81

7 Answers7

74

Simplest way to install rabbitMQ in ubuntu:

echo "deb http://www.rabbitmq.com/debian/ testing main"  | sudo tee  /etc/apt/sources.list.d/rabbitmq.list > /dev/null
wget https://www.rabbitmq.com/rabbitmq-signing-key-public.asc
sudo apt-key add rabbitmq-signing-key-public.asc
sudo apt-get update
sudo apt-get install rabbitmq-server -y
sudo service rabbitmq-server start
sudo rabbitmq-plugins enable rabbitmq_management
sudo service rabbitmq-server restart

Default username / password will be guest / guest and port for will be 15672; for UI follow - http://localhost:15672

if you want to change the username and password or add new user please follow these

sudo rabbitmqctl add_user user_name password_for_this_user
sudo rabbitmqctl set_user_tags user_name administrator
sudo rabbitmqctl set_permissions -p / user_name ".*" ".*" ".*"

and to delete guest user please run this command

sudo rabbitmqctl delete_user guest
Vikash
  • 2,046
  • 3
  • 23
  • 30
Mudaser Ali
  • 3,989
  • 3
  • 25
  • 27
  • 1
    It seems `sudo wget https://www.rabbitmq.com/rabbitmq-signing-key-public.asc` work well under Ubuntu 14.04. Rather than `http://www.rabbitmq.com/rabbitmq-signing-key-public.asc` – zangw Oct 15 '15 at 08:40
  • 5
    This didn't work for me, I got the same error when installing rabbitmq-server: `rabbitmq-server : Depends: erlang-nox (>= 1:16.b.3) but 1:15.b.1-dfsg-4+deb7u1 is to be installed or esl-erlang but it is not installable` – speedplane May 04 '16 at 04:36
  • 1
    I had an error while `apt-get update` and [this](https://askubuntu.com/questions/20725/gpg-error-the-following-signatures-couldnt-be-verified-because-the-public-key) answer fixed it. – Frankie Drake Jun 06 '17 at 10:37
  • sudo apt-get install rabbitmq-server -y --allow-unauthenticated need to be appended – cryptoKTM Jul 05 '18 at 11:23
  • This answer is not solving the problem. It doesn't work. As described in the question, some issues with `erlang` arise. – SomJura Jun 09 '20 at 14:53
  • On `sudo apt get update` I am getting `Failed to fetch https://www.rabbitmq.com/debian/dists/testing/main/binary-amd64/Packages 404 `. Any ideas? – Gulzar Nov 14 '21 at 12:14
  • please check Frankie Drake answer try it – Mudaser Ali Nov 25 '21 at 18:51
8

If Mudaser Ali answer doesn't help, then you can use the below steps. It worked for me. Please note that this answer is for ubuntu precise.

Download debain from http://www.rabbitmq.com/install-debian.html, but don't run it

Open /etc/apt/sources.list and add the below line in it

deb http://packages.erlang-solutions.com/ubuntu precise contrib

Then execute the below commands

wget http://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc
sudo apt-key add erlang_solutions.asc
sudo apt-get update
sudo apt-get install erlang
sudo apt-get install erlang-nox
sudo dpkg -i rabbitmq-server_3.2.1-1_all.deb

Reference:http://www.scotthelm.com/2013/11/27/rabbit-mq-and-erlang-and-ubuntu-oh-my.html

sag
  • 5,333
  • 8
  • 54
  • 91
  • Solved my problem, thanks. Though raabitmq-server can be installed by `sudo apt-get install rabbitmq-server` after adding repository, without downloading the binary. – MD. Khairul Basar Apr 15 '18 at 05:57
5

You might want to uninstall / remove the existing erlang-nox:

sudo apt-get remove erlang-nox

And then install rabbitmq-server (which will install the required erlang-nox). However, it will be a good idea to check whether the uninstallation / removal of the current version of erlang-nox does not break something else that is installed on your box.

  • Thanks for your willing to help here , anyways I don't think it is the case here, I think it is something related with this virsion of Ubuntu which is 8, and with the new erlang, I removed erlang-nox , and then tried to install but didn't work , check this out plz https://gist.github.com/a588340f3743190ecd0a – Eki Eqbal Jan 13 '12 at 14:51
5

The simplest way is to remove any trace of Erlang or RabbitMQ on your system, then go to http://www.erlang-solutions.com/section/132/download-erlang-otp for an Ubuntu Erlang binary (the VM that runs RabbitMQ) and then go here http://www.rabbitmq.com/download.html to get RabbitMQ.

For Erlang, choose 64 bit or the unspecified one (32 bit) depending on your OS version. There is only one binary of RabbitMQ that is fully cross platform, i.e. no change between 32 bit and 64 bit.

Get those running and you have the latest and best of both packages which are both under very active development.

That is the simplest way when you take into account the future problems that you will avoid.

Personally I would also recommend keeping mission critical application packages outside of the usual Linux filesystem layout. Whether you choose to put them in /opt, or /home/erlang or /apps or /packages doesn't matter. The important thing is to take full control of these packages and don't let the OS package manager drive your decision making.

Michael Dillon
  • 31,973
  • 6
  • 70
  • 106
2

The following commands worked for me, they are similar to @Samuel Alexander's steps, but you can just copy and paste it.

Caveat: This is for "Debian Wheezy". If you are using a different Debian version, then try changing wheezy in the second line below to your version. If you do not know your version, run the command cat /etc/*-release | grep Debian and it will tell you.

Once you know your version, and replaced "wheezy" on the second line, try this:

echo "deb http://www.rabbitmq.com/debian/ testing main" | sudo tee -a /etc/apt/sources.list
echo "deb http://packages.erlang-solutions.com/ubuntu wheezy contrib" | sudo tee -a /etc/apt/sources.list
wget http://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc
sudo apt-key add erlang_solutions.asc
sudo apt-get update
sudo apt-get -y install erlang erlang-nox
sudo apt-get -y --force-yes install rabbitmq-server
# Enable the web interface
sudo rabbitmq-plugins enable rabbitmq_management
sudo service rabbitmq-server restart
speedplane
  • 15,673
  • 16
  • 86
  • 138
0

Following the instructions at https://www.rabbitmq.com/install-debian.html has been the easiest way for me - using the Package Cloud method.

You'll have to add a repo for erlang and run the commands they've given for installing erlang, then add the package cloud repo and install rabbitmq-server. Worked like a charm for me.

Ali
  • 261,656
  • 265
  • 575
  • 769
-1
echo "deb http://www.rabbitmq.com/debian/ testing main"  | sudo tee  /etc/apt/sources.list.d/rabbitmq.list > /dev/null
wget https://www.rabbitmq.com/rabbitmq-signing-key-public.asc
sudo apt-key add rabbitmq-signing-key-public.asc
sudo apt-get update
sudo apt-get install rabbitmq-server -y
sudo service rabbitmq-server start
sudo rabbitmq-plugins enable rabbitmq_management
sudo service rabbitmq-server restart

Source : Bindas Monkeys

Mohit Bumb
  • 2,466
  • 5
  • 33
  • 52