I am trying to install mongodb 3.2 on a CentOS 7 machine and facing issues in locating the packages.
I have updated the repo file as per the documentation:
I know this issue is old and more than 2 years but I have received this error recently in Mongo DB 4.0
I have checked my yum.conf by
vi /etc/yum.conf yum.conf
and there was one line with the following.
exclude=courier* dovecot* exim* filesystem httpd* mod_ssl* **mongodb-org,mongodb-org-server,mongodb-org-shell,mongodb-org-mongos,mongodb-org-tools** mydns* nsd* p0f php* proftpd* pure-ftpd* spamassassin* squirrelmail*
Removed the
mod_ssl* mongodb-org,mongodb-org-server,mongodb-org-shell,mongodb-org-mongos,mongodb-org-tools
and changed it to
exclude=courier* dovecot* exim* filesystem httpd* mod_ssl* mydns* nsd* p0f php* proftpd* pure-ftpd* spamassassin* squirrelmail*
This has fixed my issue and should fix yours.
@nikolai.serdiuk seems to be correct. The baseurl provided in Mongo's Documentation doesn't seem to be functional. Replace that step with this instead (1):
yum-config-manager --add-repo http://repo.mongodb.org/yum/redhat/mongodb-org.repo
and then continue on with (2):
sudo yum install -y mongodb-org
Hope this helps.
This command
yum-config-manager --add-repo http://repo.mongodb.org/yum/redhat/mongodb-org.repo
will create the repo
as above suggested. Then it will work.
Check and remove old version mongodb
yum list installed mongodb.x86_64
yum remove mongodb.x86_64
It helps
first you have to create repo in your redhat system.
cd /etc/yum.repos.d/mongodb-org.repo
and Enter i
, and copy-past this.
[mongodb-org-4.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.0/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc
and save it like- enter ctrl + :
and enter : + qw
and run this command
yum install mongodb-org
I figured out what was my problem. It was in my yum.conf
file
exclude=mongodb-org,mongodb-org-server,mongodb-org-shell,mongodb-org-mongos,mongodb-org-tools
Once I commented out this line from yum.conf
, everything went fine.