You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Amazon Linux 2中无法导入Cassandra GPG密钥问题

Amazon Linux 2 上 Cassandra 3.11x 安装失败问题

此前在Amazon Linux 2上可正常安装的Cassandra,近一周安装流程失败。即使将gpgkey更新至新URL,报错仍未解决。

当前仓库配置

/etc/yum.repos.d/cassandra.repo 内容如下:

[cassandra]
name=Apache Cassandra
baseurl=https://archive.apache.org/dist/cassandra/redhat/311x/
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://www.apache.org/dist/cassandra/KEYS

安装及密钥导入报错信息

执行 sudo yum install -y cassandra 时返回错误:

正在从 https://www.apache.org/dist/cassandra/KEYS 获取密钥
cassandra/signature                                                                                                                                                | 2.9 kB  00:00:01 !!!
https://archive.apache.org/dist/cassandra/redhat/311x/repodata/repomd.xml: [错误号 -1] 未导入GPG密钥,无法验证仓库cassandra的repomd.xml
尝试其他镜像。


 已配置的仓库中有一个失败(Apache Cassandra),
 yum没有足够的缓存数据继续执行。此时yum唯一安全的操作就是终止。以下是几种可行的"修复"方式:

 1. 联系仓库上游维护者解决问题。

 2. 重新配置仓库的baseurl等参数,指向可用的上游源。这种方法通常适用于你使用的发行版版本高于仓库支持的版本,但旧版本的软件包仍能正常运行的情况。

 3. 临时禁用该仓库后执行命令:
        yum --disablerepo=cassandra ...

 4. 永久禁用该仓库,让yum默认不再使用它。之后yum会忽略该仓库,直到你永久重新启用它,或者临时使用--enablerepo参数启用:
        yum-config-manager --disable cassandra
    或者
        subscription-manager repos --disable=cassandra

 5. 配置失败的仓库在不可用时跳过。注意yum在执行大多数命令时仍会尝试联系该仓库,因此每次都会尝试并失败(导致yum运行变慢)。但如果只是临时问题,这是一个不错的折中方案:
        yum-config-manager --save --setopt=cassandra.skip_if_unavailable=true

手动导入密钥时同样报错:

sh-4.2$ sudo rpm --import https://downloads.apache.org/cassandra/KEYS
error: https://downloads.apache.org/cassandra/KEYS: 第15个密钥导入失败。

更新gpgkey至新URL后重新导入,依然报错:

sh-4.2$ sudo rpm --import https://downloads.apache.org/cassandra/KEYS
error: https://downloads.apache.org/cassandra/KEYS: 第15个密钥导入失败。


sh-4.2$ sudo curl -I https://archive.apache.org/dist/cassandra/redhat/311x/
HTTP/1.1 200 OK
Date: Mon, 24 Feb 2025 18:01:18 GMT
Server: Apache
Vary: Slow,Glacial
Content-Type: text/html;charset=UTF-8

内容的提问来源于stack exchange,提问作者Akash Deep

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.14 06:28:28