在AWS linux上通过yum安装MongoDB失败:404 -页面未找到

xdnvmnnf  于 2023-02-18  发布在  Linux
关注(0)|答案(3)|浏览(158)

我尝试通过yum在我的服务器上安装mongodb@3.4,按照MongoDB Doc上的步骤。首先,我在**/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,发现MongoDBget 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

不知道那个回购还有效吗?谢谢~
以下是我的服务器操作系统版本:

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
f5emj3cl

f5emj3cl1#

请试试这个
sudo rm -rf /etc/百胜餐饮集团d/mongod*
sudo yum清洁所有
再次创建repo文件
sudo vi /etc/百胜餐饮集团

[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

安装-y mongodb-org

0aydgbwb

0aydgbwb2#

更新至2018年3月

sudo nano /etc/yum.repos.d/mongodb-org-3.6.repo

添加(或替换)mongo repo配置:

[mongodb-org-3.6]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.6/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.6.asc

现在你可以做一个
yum repolist
以及
sudo yum install -y mongodb-org

wi3ka0sx

wi3ka0sx3#

我认为您尝试从/etc/yum.conf添加exclude目录以防止将来更新,例如:

exclude=mongodb-org,mongodb-org-server,mongodb-org-shell,mongodb-org-mongos,mongodb-org-tools

但是在执行安装mongodb-org后需要添加上面的行:

sudo yum install -y mongodb-org

因此,请从/etc/yum.conf中删除exclude行以使mongodb-org软件包可用

相关问题