8

I am using Centos 6.6 (x86_64) Trying to install most stable mongodb version available. but I am stuck with this error (which might seem repeated but none of the previous answers worked for me)

[root@localhost home]# sudo yum install -y mongodb-org
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: ftp.iitm.ac.in
 * extras: ftp.iitm.ac.in
 * updates: centos.01link.hk
http://repo.mongodb.org/yum/redhat/%24releaserver/mongodb-org/3.0/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: mongodb-org-3.0. Please verify its path and try again

My repo:

vim /etc/yum.repos.d/mongodb-org-3.0.repo

[mongodb-org-3.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releaserver/mongodb-org/3.0/x86_64/
gpgcheck=0
enabled=1

tried

yum clean all
yum check
yum erase apf
yum erase upgrade 

also tried

sudo sed -i 's/https/http/g' /etc/yum.repos.d/mongodb-org-3.0.repo

my yum.conf

[root@localhost home]# cat /etc/yum.conf
[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=5
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=19&ref=http://bugs.centos.org/bug_report_page.php?category=yum
distroverpkg=centos-release

#  This is the default, if you make this bigger yum won't see if the metadata
# is newer on the remote and so you'll "gain" the bandwidth of not having to
# download the new metadata and "pay" for it by yum not having correct
# information.
#  It is esp. important, to have correct metadata, for distributions like
# Fedora which don't keep old packages around. If you don't like this checking
# interupting your command line usage, it's much better to have something
# manually check the metadata once an hour (yum-updatesd will do this).
# metadata_expire=90m

# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
[root@localhost home]# 

Please help me figure this out !

also i have set SELinux=permissive After fixing errors which sim pointed i am getting the following error

[root@localhost Hubatrix]# yum clean all
Loaded plugins: fastestmirror, refresh-packagekit, security
Cleaning repos: base extras mongodb-org-3.0 updates
Cleaning up Everything
Cleaning up list of fastest mirrors
[root@localhost Hubatrix]# cat /etc/yum.repos.d/mongodb-org-3.0.repo
[mongodb-org-3.0]
name=MongoDB Repository 
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.0/x86_64/repodata/repomd.xml
gpgcheck=0
enabled=1

[root@localhost Hubatrix]# sudo yum install -y mongodb-org
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Determining fastest mirrors
 * base: centos.excellmedia.net
 * extras: centos.excellmedia.net
 * updates: centos.excellmedia.net
base                                                                                                                          | 3.7 kB     00:00     
base/primary_db                                                                                                               | 4.6 MB     01:21     
extras                                                                                                                        | 3.4 kB     00:00     
extras/primary_db                                                                                                             |  31 kB     00:00     
https://repo.mongodb.org/yum/redhat/6/mongodb-org/3.0/x86_64/repodata/repomd.xml/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: mongodb-org-3.0. Please verify its path and try again
hubatrix
  • 417
  • 2
  • 5
  • 11

4 Answers4

4

The error is pretty clear from yum:

http://repo.mongodb.org/yum/redhat/%24releaserver/mongodb-org/3.0/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"

There isn't a file at the other end of that URL for yum to download, hence the 404. Put that URL in your browser and start to navigate to see what files are actually there.

This is the correct URL when I browse their repo:

I suspect they moved things but didn't regenerate the repomd.xml file. You can work around the issue by downloading the packages manually and then using yum install .. to install things.

Typo

But I think there's a typo in your repo file:

baseurl=https://repo.mongodb.org/yum/redhat/$releaserver/mongodb-org/3.0/x86_64/

Should be this:

baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.0/x86_64/

slm
  • 363,520
  • 117
  • 767
  • 871
  • hello sim thanks for the reply but after I solved those typos and changed to repmod.xml i till get this error. please check the edit of my question @sim – hubatrix Jul 20 '15 at 06:47
  • @Brewmaster - please check that URL. It's still incorrect. You now have /repodata/repomd.xml repeated 2 times! – slm Jul 20 '15 at 12:43
  • @slm: FWIW, `yum localinstall` is deprecated since quite some time, simply use `yum install` as usual. From the man page: localinstall rpmfile1 [rpmfile2] [...] (**maintained for legacy reasons only - use install**) – doktor5000 Jul 20 '15 at 17:46
  • @doktor5000 - thanks, hadn't noticed that in the man pages. Says that it'll be maintained for legacy reasons there, so should be OK to use never the less, but will stop telling ppl to use it 8-). BTW, fixed the post. – slm Jul 20 '15 at 17:48
  • @doktor5000 I couldnt figure out the error there so i uninstalled the incomplete mongodb and downloaded a rpm package from their site and did rpm -ivh "package.rpm" but i am still not able to start mongod after this by path is empty (echo $path) how do i set my path to run mongod ? – hubatrix Jul 21 '15 at 11:15
  • it still says 404 https://repo.mongodb.org/yum/redhat/6/mongodb-org/3.0/x86_64/repodata/repomd.xml/repodata/repomd.xml – Cmag Jan 11 '16 at 21:38
  • @Cmag - as I stated previously the URL you just posted is wrong. It has the 'repodata/repomd.xml' repeated 2 times. Take the last out and you'll get to the repomd.xml file. – slm Jan 11 '16 at 21:48
  • 1
    @Cmag - this is the correct url: https://repo.mongodb.org/yum/redhat/6/mongodb-org/3.0/x86_64/repodata/repomd.xml – slm Jan 11 '16 at 21:49
  • Ah, i made the mistake. Do not try this repo for AWS instances :). They have their own . – Cmag Jan 12 '16 at 18:11
3

It happens if your repo configurations are dirty.

Try this

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

Then create repo again

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

Then add this:

[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 run the following command:

sudo yum install -y mongodb-org
muru
  • 69,900
  • 13
  • 192
  • 292
1

I resolved this issue by removing the /$releaserver and replaced 7Server in the link http://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.0/x86_64/ so try to replace that link with this change.

Archemar
  • 31,183
  • 18
  • 69
  • 104
Poorna
  • 11
  • 1
-2

Cleaning the cache worked for me:

sudo yum clean all
Anthon
  • 78,313
  • 42
  • 165
  • 222