使用YUM源安装
更新 Yum 包元数据:
yum update -y
yum -q makecache -y --disablerepo='*' --enablerepo='rabbitmq_erlang' --enablerepo='rabbitmq_server'
从标准存储库安装依赖项:
yum install socat logrotate -y
最后,安装现代 Erlang 和 RabbitMQ:
yum install --repo rabbitmq_erlang --repo rabbitmq_server erlang rabbitmq-server -y
使用 Zypper 安装软件包
更新 Zypper 包元数据:
zypper --gpg-auto-import-keys refresh rabbitmq_rabbitmq-server
zypper --gpg-auto-import-keys refresh rabbitmq_rabbitmq-server-source
安装软件包:
zypper install --repo rabbitmq_rabbitmq-server rabbitmq-server
使用 Cloudsmith Yum 存储库安装
带有RabbitMQ软件包的Yum存储库可从Cloudsmith获得。Cloudsmith还可用于通过yum安装最新的Erlang版本。
设置存储库的一种快速方法是使用Cloudsmith 提供的脚本。这不是必需的,应该仔细考虑,因为它将生成的脚本从公共 Internet 传送到特权 shell。
curl -1sLf 'https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/setup.rpm.sh' | sudo -E bash
本节的其余部分将重点介绍显式安装 Yum 存储库文件的更传统方式。
Yum 将验证其安装的任何软件包的签名,因此该过程的第一步是导入签名密钥
primary RabbitMQ signing key
rpm --import https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc
modern Erlang repository
rpm --import 'https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/gpg.E495BB49CC4BBE5B.key'
RabbitMQ server repository
rpm --import 'https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-server/gpg.9F4587F226208342.key'
为 RabbitMQ 和 Modern Erlang 添加 Yum 存储库
为了使用 Yum 存储库,必须在/etc/yum.repos.d/目录下添加一个 .repo 文件(例如rabbitmq.repo)。文件的内容在发行版之间会略有不同(例如,CentOS 8 和 7 与 OpenSUSE)。
Red Hat 8, CentOS 8, Modern Fedora Releases
以下示例设置了一个存储库,该存储库将从Cloudsmith安装RabbitMQ及其Erlang依赖项,并面向CentOS 8。最近的 Fedora 版本可以使用相同的存储库定义。
In /etc/yum.repos.d/rabbitmq.repo
Zero dependency Erlang RPM
[rabbitmq_erlang]
name=rabbitmq_erlang
baseurl=https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/rpm/el/8/$basearch
repo_gpgcheck=1
enabled=1
Cloudsmith's repository key and RabbitMQ package signing key
gpgkey=https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/gpg.E495BB49CC4BBE5B.key
https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc
gpgcheck=1
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
pkg_gpgcheck=1
autorefresh=1
type=rpm-md
[rabbitmq_erlang-noarch]
name=rabbitmq_erlang-noarch
baseurl=https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/rpm/el/8/noarch
repo_gpgcheck=1
enabled=1
Cloudsmith's repository key and RabbitMQ package signing key
gpgkey=https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/gpg.E495BB49CC4BBE5B.key
https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc
gpgcheck=1
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
pkg_gpgcheck=1
autorefresh=1
type=rpm-md
[rabbitmq_erlang-source]
name=rabbitmq_erlang-source
baseurl=https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/rpm/el/8/SRPMS
repo_gpgcheck=1
enabled=1
gpgkey=https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/gpg.E495BB49CC4BBE5B.key
gpgcheck=0
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
pkg_gpgcheck=1
autorefresh=1
type=rpm-md
RabbitMQ Server
[rabbitmq_server]
name=rabbitmq_server
baseurl=https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-server/rpm/el/8/$basearch
repo_gpgcheck=1
enabled=1
Cloudsmith's repository key and RabbitMQ package signing key
gpgkey=https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-server/gpg.9F4587F226208342.key
https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc
gpgcheck=1
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
pkg_gpgcheck=1
autorefresh=1
type=rpm-md
[rabbitmq_server-noarch]
name=rabbitmq_server-noarch
baseurl=https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-server/rpm/el/8/noarch
repo_gpgcheck=1
enabled=1
Cloudsmith's repository key and RabbitMQ package signing key
gpgkey=https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-server/gpg.9F4587F226208342.key
https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc
gpgcheck=1
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
pkg_gpgcheck=1
autorefresh=1
type=rpm-md
[rabbitmq_server-source]
name=rabbitmq_server-source
baseurl=https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-server/rpm/el/8/SRPMS
repo_gpgcheck=1
enabled=1
gpgkey=https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-server/gpg.9F4587F226208342.key
gpgcheck=0
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
pkg_gpgcheck=1
autorefresh=1
type=rpm-md