6

I have erlang 21.3 installed:

$ erl -eval 'erlang:display(erlang:system_info(otp_release)), halt().'  -noshell
"21"

But the rabbitmq installer does not think so:

sudo apt-get install -y rabbitmq-server
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.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 rabbitmq-server : Depends: erlang-base (>= 1:21.3) but 1:20.2.2+dfsg-1ubuntu2 is to be installed or
                            erlang-base-hipe (>= 1:21.3) but it is not going to be installed or
                            esl-erlang (>= 1:21.3) but it is not installable
                   Depends: erlang-crypto (>= 1:21.3) but 1:20.2.2+dfsg-1ubuntu2 is to be installed or
                            esl-erlang (>= 1:21.3) but it is not installable
                   Depends: erlang-eldap (>= 1:21.3) but 1:20.2.2+dfsg-1ubuntu2 is to be installed or
                            esl-erlang (>= 1:21.3) but it is not installable
                   Depends: erlang-inets (>= 1:21.3) but 1:20.2.2+dfsg-1ubuntu2 is to be installed or
                            esl-erlang (>= 1:21.3) but it is not installable
                   Depends: erlang-mnesia (>= 1:21.3) but 1:20.2.2+dfsg-1ubuntu2 is to be installed or
                            esl-erlang (>= 1:21.3) but it is not installable
                   Depends: erlang-os-mon (>= 1:21.3) but 1:20.2.2+dfsg-1ubuntu2 is to be installed or
                            esl-erlang (>= 1:21.3) but it is not installable
                   Depends: erlang-parsetools (>= 1:21.3) but 1:20.2.2+dfsg-1ubuntu2 is to be installed or
                            esl-erlang (>= 1:21.3) but it is not installable
                   Depends: erlang-public-key (>= 1:21.3) but 1:20.2.2+dfsg-1ubuntu2 is to be installed or
                            esl-erlang (>= 1:21.3) but it is not installable
                   Depends: erlang-runtime-tools (>= 1:21.3) but 1:20.2.2+dfsg-1ubuntu2 is to be installed or
                            esl-erlang (>= 1:21.3) but it is not installable
                   Depends: erlang-ssl (>= 1:21.3) but 1:20.2.2+dfsg-1ubuntu2 is to be installed or
                            esl-erlang (>= 1:21.3) but it is not installable
                   Depends: erlang-syntax-tools (>= 1:21.3) but 1:20.2.2+dfsg-1ubuntu2 is to be installed or
                            esl-erlang (>= 1:21.3) but it is not installable
                   Depends: erlang-tools (>= 1:21.3) but 1:20.2.2+dfsg-1ubuntu2 is to be installed or
                            esl-erlang (>= 1:21.3) but it is not installable
                   Depends: erlang-xmerl (>= 1:21.3) but 1:20.2.2+dfsg-1ubuntu2 is to be installed or
                            esl-erlang (>= 1:21.3) but it is not installable
E: Unable to correct problems, you have held broken packages.

Note: the following question is similar - but for RedHat and the yum install instructions are not directly applicable for apt-get Installing RabbitMQ on Red Hat - wrong Erlang version

What needs to be done to fix this installation process? I am on ubuntu 18.0.4.

WestCoastProjects
  • 58,982
  • 91
  • 316
  • 560

4 Answers4

5

The following sequence of commands will install Erlang and RabbitMQ on Ubuntu 18, as documented here:

export DEBIAN_FRONTEND=noninteractive

apt-get update -y

apt-get install curl gnupg -y

curl -fsSL https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc | apt-key add -

apt-get install apt-transport-https

tee /etc/apt/sources.list.d/bintray.rabbitmq.list <<EOF
deb https://dl.bintray.com/rabbitmq-erlang/debian bionic erlang
deb https://dl.bintray.com/rabbitmq/debian bionic main
EOF

apt-get update -y

apt-get install rabbitmq-server -y --fix-missing

until lsof -i:5672; do echo "Waiting for RabbitMQ to start..."; sleep 1; done
rabbitmq-plugins enable rabbitmq_management

If you choose to install Erlang from source you're on your own and I suggest using the generic-unix RabbitMQ package.


NOTE: the RabbitMQ team monitors the rabbitmq-users mailing list and only sometimes answers questions on StackOverflow.

Luke Bakken
  • 8,993
  • 2
  • 20
  • 33
3

Encountered similar scenario recently while installing rabbitmq. Installing erlang using PPA

wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
sudo dpkg -i erlang-solutions_1.0_all.deb

sudo apt-get update
sudo apt-get install erlang
sudo apt-get install esl-erlang

as described here worked for me

dc7
  • 401
  • 1
  • 4
  • 13
2

I experienced similar issue while installing elixir. I believe the reason is an existing installation of erlang is blocking the installation of required versions of erlang offered by two different packages.

For me, installing esl-erlang along with elixir solved the issue, e.g., sudo apt-get install elixir esl-erlang. So, you might want to explicitly install the required version of erlang-base or esl-erlang.

  • I installed `erlang` from source - so then how does that all work? – WestCoastProjects Dec 27 '19 at 03:19
  • I doubt apt recognizes software installed not using apt. So, if you install erlang via apt, then this apt-based installation of erlang may overwrite your previous source-based installation of erlang. In such situations, it is best to remove the software installed from source and then install it using apt. [Here](https://stackoverflow.com/a/25625801/1366696) the instruction to uninstall erlang installed from source. – Venkatesh-Prasad Ranganath Dec 27 '19 at 03:31
  • I have seen many folks having issues with the `3.8` of `rabbitmq` and I have msyelf tried too many things. It looks like the deprecated 3.6.12 tries to install but then it does not run. `RIP` rabbitmq – WestCoastProjects Dec 27 '19 at 03:37
  • If it helps, rabbitmq 3.7.8 bundled with Ubuntu 19.10 seems to install and run fine (not the same as works fine in all regards). – Venkatesh-Prasad Ranganath Dec 27 '19 at 18:35
  • Installation works 100% of the time _if you read and follow the instructions_: https://www.rabbitmq.com/install-debian.html – Luke Bakken Dec 27 '19 at 19:43
0

While installing RabbitMq 3.11.7 / Erlang OTP 25 / Ubuntu 20.04 received this set of errors The following packages have unmet dependencies: rabbitmq-server : Depends: erlang-base (>= 1:25.0) but 1:22.2.7+dfsg-1 is to be installed..

Resolved by following Cloudsmith Quick Start Script at https://www.rabbitmq.com/install-debian.html This means installing both Erlang and RabbitMq Repositories. The error was resolved after these steps were put in sequence.

#!/usr/bin/sh

sudo apt-get install curl gnupg apt-transport-https -y

## Team RabbitMQ's main signing key
curl -1sLf "https://keys.openpgp.org/vks/v1/by-fingerprint/0A9AF2115F4687BD29803A206B73A36E6026DFCA" | sudo gpg --dearmor | sudo tee /usr/share/keyrings/com.rabbitmq.team.gpg > /dev/null
## Cloudsmith: modern Erlang repository
curl -1sLf https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/gpg.E495BB49CC4BBE5B.key | sudo gpg --dearmor | sudo tee /usr/share/keyrings/io.cloudsmith.rabbitmq.E495BB49CC4BBE5B.gpg > /dev/null
## Cloudsmith: RabbitMQ repository
curl -1sLf https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-server/gpg.9F4587F226208342.key | sudo gpg --dearmor | sudo tee /usr/share/keyrings/io.cloudsmith.rabbitmq.9F4587F226208342.gpg > /dev/null

## Add apt repositories maintained by Team RabbitMQ
sudo tee /etc/apt/sources.list.d/rabbitmq.list <<EOF
## Provides modern Erlang/OTP releases
##
deb [signed-by=/usr/share/keyrings/io.cloudsmith.rabbitmq.E495BB49CC4BBE5B.gpg] https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/deb/ubuntu bionic main
deb-src [signed-by=/usr/share/keyrings/io.cloudsmith.rabbitmq.E495BB49CC4BBE5B.gpg] https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/deb/ubuntu bionic main

## Provides RabbitMQ
##
deb [signed-by=/usr/share/keyrings/io.cloudsmith.rabbitmq.9F4587F226208342.gpg] https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-server/deb/ubuntu bionic main
deb-src [signed-by=/usr/share/keyrings/io.cloudsmith.rabbitmq.9F4587F226208342.gpg] https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-server/deb/ubuntu bionic main
EOF

## Update package indices
sudo apt-get update -y

## Install Erlang packages
sudo apt-get install -y erlang-base \
                        erlang-asn1 erlang-crypto erlang-eldap erlang-ftp erlang-inets \
                        erlang-mnesia erlang-os-mon erlang-parsetools erlang-public-key \
                        erlang-runtime-tools erlang-snmp erlang-ssl \
                        erlang-syntax-tools erlang-tftp erlang-tools erlang-xmerl

## Install rabbitmq-server and its dependencies
sudo apt-get install rabbitmq-server -y --fix-missing