How to use official RabbitMQ repository on Debian Buster

RabbitMQ uses Bintray to provide official repositories for RabbitMQ message broker and Erlang, but there is a small catch as at this moment repository for Debian Buster does not contain RabbitMQ application...

Display distribution-specific information.

$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 10 (buster)
Release:        10
Codename:       buster

The problem

Install gnupg2, apt-transport-https and curl.

$ sudo apt install gnupg2 apt-transport-https curl

Import repository key.

$ curl https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc | sudo apt-key add -

Define RabbitMQ and Erlang repositories.

$ echo "deb https://dl.bintray.com/rabbitmq/debian buster main"               | sudo tee    /etc/apt/sources.list.d/rabbitmq.list
$ echo "deb https://dl.bintray.com/rabbitmq-erlang/debian buster erlang-22.x" | sudo tee -a /etc/apt/sources.list.d/rabbitmq.list 

Verify repository configuration.

$ cat /etc/apt/sources.list.d/rabbitmq.list 
deb https://dl.bintray.com/rabbitmq/debian buster main
deb https://dl.bintray.com/rabbitmq-erlang/debian buster erlang-22.x

Update package index.

$ sudo apt update

Check available erlang version.

$ apt-cache policy erlang
erlang:
  Installed: (none)
  Candidate: 1:22.0.7-1
  Version table:
     1:22.0.7-1 500
        500 https://dl.bintray.com/rabbitmq-erlang/debian buster/erlang-22.x amd64 Packages
     1:22.0.6-1 500
        500 https://dl.bintray.com/rabbitmq-erlang/debian buster/erlang-22.x amd64 Packages
     1:22.0-1 500
        500 https://dl.bintray.com/rabbitmq-erlang/debian buster/erlang-22.x amd64 Packages
     1:21.2.6+dfsg-1 500
        500 http://deb.debian.org/debian buster/main amd64 Packages

Check available rabbitmq-server version.

$ apt-cache policy rabbitmq-server
rabbitmq-server:
  Installed: (none)
  Candidate: 3.7.8-4
  Version table:
     3.7.8-4 500
        500 http://deb.debian.org/debian buster/main amd64 Packages
There is only a package provided by the standard Debian repository.

This is because package index is empty.

$ curl https://dl.bintray.com/rabbitmq/debian/dists/buster/main/binary-amd64/Packages
$

The solution

The solution is to use package for Debian Stretch (see the next section below).

$ curl --silent https://dl.bintray.com/rabbitmq/debian/dists/stretch/main/binary-amd64/Packages | head -16
Package: rabbitmq-server
Version: 3.6.15-1
Architecture: all
Maintainer: RabbitMQ Team 
Installed-Size: 5693
Depends: init-system-helpers (>= 1.13~), erlang-nox (>= 1:16.b.3) | esl-erlang (>= 1:16.b.3), adduser, logrotate, socat
Section: net
Priority: extra
Homepage: http://www.rabbitmq.com/
Description: Multi-protocol messaging broker
 RabbitMQ is an open source multi-protocol messaging broker.
Filename: pool/rabbitmq-server/rabbitmq-server_3.6.15-1_all.deb
SHA1: 08d3ffbb230f5fef4a6b63de90d3ad3475048b70
SHA256: 864f5ac7fc7b8aa755bfc2e8e03f6502be736300c2c1fe1097cc197513e19c4e
Size: 5024984

Define RabbitMQ and Erlang repositories.

$ echo "deb https://dl.bintray.com/rabbitmq/debian stretch main"              | sudo tee    /etc/apt/sources.list.d/rabbitmq.list
$ echo "deb https://dl.bintray.com/rabbitmq-erlang/debian buster erlang-22.x" | sudo tee -a /etc/apt/sources.list.d/rabbitmq.list 

Verify repository configuration.

$ cat /etc/apt/sources.list.d/rabbitmq.list 
deb https://dl.bintray.com/rabbitmq/debian stretch main
deb https://dl.bintray.com/rabbitmq-erlang/debian buster erlang-22.x

Update package index.

$ sudo apt update

Check available rabbitmq-server version.

$ apt-cache policy rabbitmq-server
rabbitmq-server:
  Installed: (none)
  Candidate: 3.7.17-1
  Version table:
     3.7.17-1 500
        500 https://dl.bintray.com/rabbitmq/debian stretch/main amd64 Packages
[...]
     3.7.9-1 500
        500 https://dl.bintray.com/rabbitmq/debian stretch/main amd64 Packages
     3.7.8-4 500
        500 http://deb.debian.org/debian buster/main amd64 Packages
     3.7.8-1 500
        500 https://dl.bintray.com/rabbitmq/debian stretch/main amd64 Packages
[...]
     3.6.15-1 500
        500 https://dl.bintray.com/rabbitmq/debian stretch/main amd64 Packages

Install RabbitMQ server as it will work as expected.

$ sudo apt-get install rabbitmq-server

The cause

Hmm, there is no Debian Buster AMI available on Amazon EC2 yet (neither an official, nor a community one). We use this to test packages and without this, I feel unconfident to publish a package never tested on Buster...

We will watch for the Debian Buster image to appear. In the meantime, you can try to take the package from the Debian Stretch repository: really, we build the Debian package once (on Debian Jessie), test it on all Debian/Ubuntu versions and publish it to all tested versions.