3

I followed this website to install RabbitMQ https://attacomsian.com/blog/install-rabbitmq-macos-ubuntu

On the 5th step where it install RabbitMq, When I run the command I get this error

rabbitmq-server.service - RabbitMQ Messaging Server
     Loaded: loaded (/lib/systemd/system/rabbitmq-server.service; enabled; vendor preset: enabled)
     Active: activating (auto-restart) (Result: exit-code) since Fri 2021-08-20 10:11:27 IST; 5ms ago
    Process: 361473 ExecStart=/usr/sbin/rabbitmq-server (code=exited, status=1/FAILURE)
   Main PID: 361473 (code=exited, status=1/FAILURE)
dpkg: error processing package rabbitmq-server (--configure):
 installed rabbitmq-server package post-installation script subprocess returned error exit status 1
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for systemd (245.4-4ubuntu3.11) ...
Errors were encountered while processing:
 rabbitmq-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

when I run sudo apt update, this error is showing

    E: The repository 'http://www.rabbitmq.com/debian testing Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
Rao DYC
  • 33
  • 1
    The command in "step 5" of the link you posted would not produce that output unless you have chopped it up. You should include the full unredacted output as well as the actual command that you are running. Did you update the list of available software and is your system up-to-date? These are prerequisites for installing any new software. You should include the output of sudo apt update. – Nmath Aug 20 '21 at 05:56

2 Answers2

3

Please follow the official documentation: https://www.rabbitmq.com/install-debian.html#apt-quick-start-packagecloud

with a simple script, you can easily install rabbitmq on ubuntu.

for example:

#!/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 > /usr/share/keyrings/com.rabbitmq.team.gpg

Launchpad PPA that provides modern Erlang releases

curl -1sLf "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xf77f1eda57ebb1cc" | sudo gpg --dearmor > /usr/share/keyrings/net.launchpad.ppa.rabbitmq.erlang.gpg

PackageCloud RabbitMQ repository

curl -1sLf "https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey" | sudo gpg --dearmor > /usr/share/keyrings/io.packagecloud.rabbitmq.gpg

Add apt repositories maintained by Team RabbitMQ

sudo tee /etc/apt/sources.list.d/rabbitmq.list <<EOF

Provides modern Erlang/OTP releases

"focal" as distribution name should work for any reasonably recent Ubuntu or Debian release.

See the release to distribution mapping table in RabbitMQ doc guides to learn more.

deb [signed-by=/usr/share/keyrings/net.launchpad.ppa.rabbitmq.erlang.gpg] http://ppa.launchpad.net/rabbitmq/rabbitmq-erlang/ubuntu focal main deb-src [signed-by=/usr/share/keyrings/net.launchpad.ppa.rabbitmq.erlang.gpg] http://ppa.launchpad.net/rabbitmq/rabbitmq-erlang/ubuntu focal main

Provides RabbitMQ

"focal" as distribution name should work for any reasonably recent Ubuntu or Debian release.

See the release to distribution mapping table in RabbitMQ doc guides to learn more.

deb [signed-by=/usr/share/keyrings/io.packagecloud.rabbitmq.gpg] https://packagecloud.io/rabbitmq/rabbitmq-server/ubuntu/ focal main deb-src [signed-by=/usr/share/keyrings/io.packagecloud.rabbitmq.gpg] https://packagecloud.io/rabbitmq/rabbitmq-server/ubuntu/ focal 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

and ..

root@ubuntu-focal:/home/vagrant# rabbitmqctl status
Status of node rabbit@ubuntu-focal ...
Runtime

OS PID: 4038 OS: Linux Uptime (seconds): 14 Is under maintenance?: false RabbitMQ version: 3.9.4 Node name

1

This happens because of an environment variable reload, in file

/var/lib/dpkg/info/rabbitmq-server.postinst,

the line:

. /etc/profile

You could comment it out and do: apt install --fix-broken -y

zersh
  • 211
  • 2
  • 6