linux - 在 AWS linux 上通过 yum 安装 MongoDB 失败 : HTTPS Error 404 - Not Found

标签 linux mongodb amazon yum

我试图按照 MongoDB Doc 上的步骤通过 yum 在我的服务器上安装 mongodb@3.4。 .首先,我在 /etc/yum.repos.d/ 目录中创建了一个名为 mongodb-org-3.4.repo 的文件,并复制如下文本。

[mongodb-org-3.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/amazon/2013.03/mongodb-org/3.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc

然后我尝试了 sudo yum install mongodb-org 但出现了错误。

Loaded plugins: priorities, update-motd, upgrade-helper
amzn-main                             | 2.1 kB     00:00
amzn-updates                          | 2.3 kB     00:00
https://repo.mongodb.org/yum/redhat/latest/mongodb-org/3.4/x86_64/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
Trying other mirror.
To address this issue please refer to the below knowledge base article

https://access.redhat.com/articles/1320623

If above article doesn't help to resolve this issue please open a ticket with Red Hat Support.



One of the configured repositories failed (MongoDB),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:

1. Contact the upstream for the repository and get them to fix the problem.

2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).

3. Disable the repository, so yum won't use it by default. Yum will then
just ignore the repository until you permanently enable it again or use
--enablerepo for temporary usage:

yum-config-manager --disable mongodb-org-3.4

4. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:

yum-config-manager --save --setopt=mongodb-org-3.4.skip_if_unavailable=true

failure: repodata/repomd.xml from mongodb-org-3.4: [Errno 256] No more mirrors to try.
https://repo.mongodb.org/yum/redhat/latest/mongodb-org/3.4/x86_64/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found

之后,我尝试了yum repolist,发现MongoDB的状态为0。

Loaded plugins: priorities, update-motd, upgrade-helper
amzn-main                             | 2.1 kB     00:00
amzn-updates                          | 2.3 kB     00:00
https://repo.mongodb.org/yum/redhat/latest/mongodb-org/3.4/x86_64/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
Trying other mirror.
To address this issue please refer to the below knowledge base article

https://access.redhat.com/articles/1320623

If above article doesn't help to resolve this issue please open a ticket with Red Hat Support.

https://repo.mongodb.org/yum/redhat/latest/mongodb-org/3.4/x86_64/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
Trying other mirror.
nodesource/x86_64                     | 2.5 kB     00:00
repo id                repo name                       status
amzn-main/latest       amzn-main-Base                  5,668
amzn-updates/latest    amzn-updates-Base                 435
mongodb-org-3.4/latest MongoDB                             0
nodesource/x86_64      Node.js Packages for Enterprise    61
repolist: 6,164 

我想知道那个 repo 是否仍然有效?谢谢~

这是我的服务器操作系统版本:

NAME="Amazon Linux AMI"
VERSION="2017.03"
ID="amzn"
ID_LIKE="rhel fedora"
VERSION_ID="2017.03"
PRETTY_NAME="Amazon Linux AMI 2017.03"
ANSI_COLOR="0;33"
CPE_NAME="cpe:/o:amazon:linux:2017.03:ga"
HOME_URL="http://aws.amazon.com/amazon-linux-ami/"
Amazon Linux AMI release 2017.03

最佳答案

请试试这个,

sudo rm -rf/etc/yum.repos.d/mongod*

sudo yum clean all

再次创建repo文件

sudo vi/etc/yum.repos.d/mongodb-org-3.4.repo

[mongodb-org-3.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/amazon/2013.03/mongodb-org/3.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc

sudo yum install -y mongodb-org

关于linux - 在 AWS linux 上通过 yum 安装 MongoDB 失败 : HTTPS Error 404 - Not Found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44517229/

相关文章:

python - 解释性语言如何避免使用全局解释器锁(GIL)?

c - TIOGCPKT 未实现?

c - 无需等待接收整个文件即可发送文件

mysql - 比较同一组字符的加密值

mongodb - 如何在新闻中使用$Orderby-C

javascript - ( Node :5700) DeprecationWarning: Mongoose: mpromise (mongoose's default promise library) is deprecated, 插入你自己的 Promise 库

mysql - 如何模拟MongoDB查询条件中的子查询

amazon-ec2 - 使用 Hadoop 处理来自 Web 服务器的实时日志提要

android - 使用eclipse生成apk文件以将应用程序提交到亚马逊的最佳方法是什么?

amazon-web-services - 访问拒绝上传到 s3