Installing MongoDB via yum on AWS linux fails: HTTPS Error 404 - Not Found
Asked Answered
A

3

7

I was trying to install [email protected] via yum on my server by following the steps on MongoDB Doc. First, I created a file called mongodb-org-3.4.repo in /etc/yum.repos.d/ directory and copied the text as below.

[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

Then I tried sudo yum install mongodb-org but got an error on it.

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

After that, I tried yum repolist and found out the status of MongoDB get 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 

I wonder whether that repo is still valid or not? Thank you~

Here's my server OS version:

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
Appraisal answered 13/6, 2017 at 9:17 Comment(3)
Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See What topics can I ask about here in the Help Center. Perhaps Web Applications Stack Exchange, Webmaster Stack Exchange or Unix & Linux Stack Exchange would be a better place to ask.Pediform
Oops, sry abt that. Cause I'm used to search for any solution related to coding in Stack Overflow. Thx for your suggestion, I will try other platform to ask next time;)Appraisal
I am facing similar problem. I am tring to upgrade from v3.0.11 to v3.2.20 and i already tried solution below but it's not working for meEssonite
A
32

Please try this,

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

sudo yum clean all

again create repo file

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

Antoneantonella answered 13/6, 2017 at 12:15 Comment(2)
Wow~Work like a charm~Thx a lot XDAppraisal
Yes. File name matters. I changed it to mongodb-org-3.4 from mongodb-org. Now it works.Myron
G
1

I think you try to add exclude directory from /etc/yum.conf to prevent future updates for example:

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

But above line need to be added after perform install mongodb-org:

sudo yum install -y mongodb-org

So, remove the exclude line from /etc/yum.conf to make the mongodb-org package available

Gittel answered 6/7, 2020 at 10:26 Comment(0)
H
0

updated to March/2018

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

add (or replace) the mongo repo configuration:

[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

now, you're able to do a

yum repolist

and

sudo yum install -y mongodb-org

Hendon answered 25/3, 2018 at 0:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.