使用 PackageCloud Yum 存储库安装

PackageCloud 提供了一个包含 RabbitMQ 包的 Yum 存储库。Package Cloud 也可用于通过 yum 安装最新的 Erlang 版本

使用 PackageCloud 提供的初始化脚本配置Yum 存储库

设置存储库的一种快速方法是使用Package Cloud 提供的脚本。这不是必需的,应该仔细考虑,因为它将生成的脚本从公共 Internet 传输到特权 shell。

## Uses a PackageCloud-provided Yum repository setup script.
## Always verify what is downloaded before piping it to a privileged shell!
curl -s https://packagecloud.io/install/repositories/rabbitmq/rabbitmq-server/script.rpm.sh | sudo bash

手动配置基于PackageCloud的 Yum 存储库

1、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://packagecloud.io/rabbitmq/erlang/gpgkey
## RabbitMQ server repository
rpm --import https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey

请注意,如果上述任何导入命令因 SHA1 哈希算法而以错误结束,则必须先执行以下命令:

sudo update-crypto-policies --set LEGACY

然后重试失败的导入命令。

2、为 RabbitMQ 和 Modern Erlang 添加 Yum 存储库

为了使用 Yum 存储库,必须在/etc/yum.repos.d/目录下添加一个.repo文件(例如rabbitmq.repo ) 。文件的内容会因发行版(例如 CentOS Stream 9CentOS Stream 8OpenSUSE)而略有不同。

Red Hat 8、CentOS Stream 9、CentOS 8、现代 Fedora 发布

以下示例设置了一个存储库,该存储库将安装 RabbitMQ 及其来自 PackageCloud 的 Erlang 依赖项,并以CentOS Stream 和 CentOS 8为目标。最近的 Fedora 版本可以使用相同的存储库定义。

# In /etc/yum.repos.d/rabbitmq.repo

##
## Zero dependency Erlang
##

[rabbitmq_erlang]
name=rabbitmq_erlang
baseurl=https://packagecloud.io/rabbitmq/erlang/el/8/$basearch
repo_gpgcheck=1
gpgcheck=1
enabled=1
# PackageCloud's repository key and RabbitMQ package signing key
gpgkey=https://packagecloud.io/rabbitmq/erlang/gpgkey
       https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300

[rabbitmq_erlang-source]
name=rabbitmq_erlang-source
baseurl=https://packagecloud.io/rabbitmq/erlang/el/8/SRPMS
repo_gpgcheck=1
gpgcheck=0
enabled=1
# PackageCloud's repository key and RabbitMQ package signing key
gpgkey=https://packagecloud.io/rabbitmq/erlang/gpgkey
       https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300

##
## RabbitMQ server
##

[rabbitmq_server]
name=rabbitmq_server
baseurl=https://packagecloud.io/rabbitmq/rabbitmq-server/el/8/$basearch
repo_gpgcheck=1
gpgcheck=0
enabled=1
# PackageCloud's repository key and RabbitMQ package signing key
gpgkey=https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey
       https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300

[rabbitmq_server-source]
name=rabbitmq_server-source
baseurl=https://packagecloud.io/rabbitmq/rabbitmq-server/el/8/SRPMS
repo_gpgcheck=1
gpgcheck=0
enabled=1
gpgkey=https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
OpenSUSE

以下示例针对 OpenSUSE,并且仅安装 RabbitMQ 包存储库。假定 Erlang 是从devel:languages:erlang:Factory存储库提供的

[rabbitmq_rabbitmq-server]
name=rabbitmq_rabbitmq-server
baseurl=https://packagecloud.io/rabbitmq/rabbitmq-server/opensuse/15.1/$basearch
enabled=1
repo_gpgcheck=1
pkg_gpgcheck=0
gpgkey=https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey
       https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc
autorefresh=1
type=rpm-md

[rabbitmq_rabbitmq-server-source]
name=rabbitmq_rabbitmq-server-source
baseurl=https://packagecloud.io/rabbitmq/rabbitmq-server/opensuse/15.1/SRPMS
enabled=1
repo_gpgcheck=1
pkg_gpgcheck=0
gpgkey=https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey
autorefresh=1
type=rpm-md

安装软件包

使用 Yum 安装软件包

Red Hat 8、CentOS Stream、CentOS 8、Modern Fedora;

更新 Yum 包元数据:

yum update -y
yum -q makecache -y --disablerepo='*' --enablerepo='rabbitmq_erlang' --enablerepo='rabbitmq_server'

接下来从标准存储库安装依赖项:

## install these dependencies from standard OS repositories
yum install socat logrotate -y

最后,安装 Modern Erlang 和 RabbitMQ:

## install RabbitMQ and zero dependency Erlang from the above repositories,
## ignoring any versions provided by the standard repositories
yum install --repo rabbitmq_erlang --repo rabbitmq_server erlang rabbitmq-server -y
使用 Zypper 安装软件包

首先,更新 Zypper 包元数据:

## refresh the repository. These verbose repository names are used by PackageCloud
zypper --gpg-auto-import-keys refresh rabbitmq_rabbitmq-server
zypper --gpg-auto-import-keys refresh rabbitmq_rabbitmq-server-source

然后安装软件包:

## install the package from PackageCloud repository
zypper install --repo rabbitmq_rabbitmq-server rabbitmq-server
作者:Jeebiz  创建时间:2023-04-06 18:54
最后编辑:Jeebiz  更新时间:2024-11-01 10:06