RabbitMQ - Packages have unmet dependencies

6,234

The first step to solve your issue is to revert the effects of your commands.

Let's start with your first command.

echo "deb http://www.rabbitmq.com/debian/ testing main"  | sudo tee  /etc/apt/sources.list.d/rabbitmq.list > /dev/null

This is creating a the file /etc/apt/sources.list.d/rabbitmq.list. So you want to delete this file. To delete the file run the following command.

sudo rm /etc/apt/sources.list.d/rabbitmq.list

Your next command is downloading a file.

wget https://www.rabbitmq.com/rabbitmq-signing-key-public.asc

You can just delete the file if you know where it was downloaded. It should be downloaded in the directory from which your command was executed. If you just opened a terminal, it is very likely that it is in your home directory.

The next command is adding a gpg key with apt-key. So you have to remove the gpg key. See the answers to this How can I remove gpg key that I added using apt-key add -?.

Now that you have removed the gpg key. You should run sudo apt update

You are now ready to install RabbitMQ following the official instructions. The official instructions are not the best organized. However I have tried to distill the commands for ubuntu 16.04.

First step is to install Erlang. Run the following commands. Here I am just copying commands from the link.

curl -fsSL https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc | sudo apt-key add -
sudo apt-get install apt-transport-https
echo "deb http://dl.bintray.com/rabbitmq-erlang/debian xenial erlang-22.x" >  | sudo tee  /etc/apt/sources.list.d/bintray.erlang.list > /dev/null
sudo apt-get update -y
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

Now you should have Erlang installed. Now you can install RabbitMQ. You should run the following commands.

sudo apt-get install curl gnupg -y
curl -fsSL https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc | sudo apt-key add -
echo "deb https://dl.bintray.com/rabbitmq/debian xenial main" | sudo tee /etc/apt/sources.list.d/bintray.rabbitmq.list
sudo apt-get update -y
sudo apt-get install -y rabbitmq-server

You should have RabbitMQ installed now.

Share:
6,234
rahul.m
Author by

rahul.m

Updated on September 18, 2022

Comments

  • rahul.m
    rahul.m over 1 year

    i am following this steps to install rabbitmq on ubuntu 16

    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
    

    after executing >> sudo apt-get install rabbitmq-server -y i am getting following error

    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:18.3-dfsg-1ubuntu3.1 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:18.3-dfsg-1ubuntu3.1 is to be installed or
                                esl-erlang (>= 1:21.3) but it is not installable
                       Depends: erlang-eldap (>= 1:21.3) but 1:18.3-dfsg-1ubuntu3.1 is to be installed or
                                esl-erlang (>= 1:21.3) but it is not installable
                       Depends: erlang-inets (>= 1:21.3) but 1:18.3-dfsg-1ubuntu3.1 is to be installed or
                                esl-erlang (>= 1:21.3) but it is not installable
                       Depends: erlang-mnesia (>= 1:21.3) but 1:18.3-dfsg-1ubuntu3.1 is to be installed or
                                esl-erlang (>= 1:21.3) but it is not installable
                       Depends: erlang-os-mon (>= 1:21.3) but 1:18.3-dfsg-1ubuntu3.1 is to be installed or
                                esl-erlang (>= 1:21.3) but it is not installable
                       Depends: erlang-parsetools (>= 1:21.3) but 1:18.3-dfsg-1ubuntu3.1 is to be installed or
                                esl-erlang (>= 1:21.3) but it is not installable
                       Depends: erlang-public-key (>= 1:21.3) but 1:18.3-dfsg-1ubuntu3.1 is to be installed or
                                esl-erlang (>= 1:21.3) but it is not installable
                       Depends: erlang-runtime-tools (>= 1:21.3) but 1:18.3-dfsg-1ubuntu3.1 is to be installed or
                                esl-erlang (>= 1:21.3) but it is not installable
                       Depends: erlang-ssl (>= 1:21.3) but 1:18.3-dfsg-1ubuntu3.1 is to be installed or
                                esl-erlang (>= 1:21.3) but it is not installable
                       Depends: erlang-syntax-tools (>= 1:21.3) but 1:18.3-dfsg-1ubuntu3.1 is to be installed or
                                esl-erlang (>= 1:21.3) but it is not installable
                       Depends: erlang-tools (>= 1:21.3) but 1:18.3-dfsg-1ubuntu3.1 is to be installed or
                                esl-erlang (>= 1:21.3) but it is not installable
                       Depends: erlang-xmerl (>= 1:21.3) but 1:18.3-dfsg-1ubuntu3.1 is to be installed or
                                esl-erlang (>= 1:21.3) but it is n
    
    • guiverc
      guiverc over 4 years
      Debian testing (11/Bullseye) is expected to be released in 2021; which is a distance from a 2016 release - so are you surprised by the issues? There is no Ubuntu 16, there is Ubuntu Core 16 & Ubuntu 16.04 - but either represent a 2016 release.
    • user535733
      user535733 over 4 years
      rabbitmq-server 3.5.7 is already in the Ubuntu 16.04 repositories, so I do not understand why you seem to be trying to install the package a much harder way. Nor do I understand why you are using apt's -y flag on such a risky operation.
    • Luke Bakken
      Luke Bakken over 4 years
      RabbitMQ 3.5.7 is very old and unsupported. Please do not use it.
    • Luke Bakken
      Luke Bakken over 4 years
      I have confirmed that this Vagrantfile correctly installs the latest RabbitMQ and Erlang on Ubuntu 16 - gist.github.com/lukebakken/bd90852537928b4f8801bae9aa051bf0
    • Ibraheem Moosa
      Ibraheem Moosa over 4 years
      While the problem the user is facing is unmet dependencies, the real issue here is how to install RabbitMQ in Ubuntu 16. I do not think this question should be marked duplicate.