yum install mongodb 3.2 fails
Asked Answered
L

13

13

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:

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

When running sudo yum install mongodb-org I am getting this error:

[centos@ip-10-24-1-228 ~]$ sudo yum install mongodb-org
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.osuosl.org
 * epel: linux.mirrors.es.net
 * extras: mirror.lax.hugeserver.com
 * updates: mirror.hmc.edu
No package mongodb-org available.
Error: Nothing to do

Why do I get this message?

Laborsaving answered 11/1, 2016 at 15:46 Comment(0)
L
12

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.

Laborsaving answered 12/1, 2016 at 9:49 Comment(1)
Stupid obvious - but my issue alsoMattern
H
17

You need to configure the package management system (yum).

Create a /etc/yum.repos.d/mongodb.repo file to hold the following configuration information for the MongoDB repository:

If you have a 64bit system, use the following config:

[mongodb]
name=MongoDB Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/
gpgcheck=0
enabled=1

32bit isn't recommended for production deployments, but you may use:

[mongodb]
name=MongoDB Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/i686/
gpgcheck=0
enabled=1

When you install the packages, you choose whether to install the current release or a previous one. This step provides the commands for both.

To install the latest stable version of MongoDB, run:

sudo yum install mongodb-org

To install a specific release of MongoDB, specify each component package individually and append to it the version number to the package name, as in the following example that installs the 3.2.0 release:

yum install mongodb-org-3.2.0 mongodb-org-server-3.2.0 mongodb-org-shell-3.2.0 mongodb-org-mongos-3.2.0 mongodb-org-tools-3.2.0

If you are still stuck, following this carefully might be helpful.

Histamine answered 11/1, 2016 at 16:5 Comment(2)
Thanks for your reply.I have already done that. I have created the repo file in /etc/yum.repos.d and I am getting error message after every time followed in the documentation.Laborsaving
This saved my ass. The script on Mongodb.org does not work, but this one worked just file. Installed the 64 bit version using itSepulture
L
12

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.

Laborsaving answered 12/1, 2016 at 9:49 Comment(1)
Stupid obvious - but my issue alsoMattern
P
6

You should know that this URL https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.2/x86_64/ is not working anymore.

Go to http://repo.mongodb.org/yum/redhat/ and download mongodb-org.repo file.

Configure the package management system (yum), copy mongodb-org.repo to /etc/yum.repos.d/, so that you can install MongoDB directly, using yum.

Install the MongoDB packages and associated tools.

sudo yum install -y mongodb-org mongodb-org-server

Unfortunatelly mongodb website documentation suggests using https://docs.mongodb.org/manual/tutorial/install-mongodb-on-red-hat/, but this is wrong way.

Petrozavodsk answered 26/3, 2016 at 9:23 Comment(0)
W
1

This is a more recent version of Idos answer from Install MongoDB Community Edition on Red Hat Enterprise or CentOS Linux.

Configure the package management system (yum).

Create a /etc/yum.repos.d/mongodb.repo file so that you can install MongoDB directly, using yum.

For MongoDB 3.6

Use the following repository file:

[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

For versions of MongoDB earlier than 3.6

To install the packages from an earlier release series such as 3.4, you can specify the release series in the repository configuration. For example, to restrict your system to the 3.4 release series, create a /etc/yum.repos.d/mongodb.repo file to hold the following configuration information for the MongoDB 3.4 repository:

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

You can find .repo files for each release in the repository itself. Remember that odd-numbered minor release versions (e.g. 3.5) are development versions and are unsuitable for production use.

Install the MongoDB packages.

To install the latest stable version of MongoDB, issue the following command:

sudo yum install -y mongodb-org

To install a specific release of MongoDB, specify each component package individually and append the version number to the package name, as in the following example:

sudo yum install -y mongodb-org-3.6.4 mongodb-org-server-3.6.4 mongodb-org-shell-3.6.4 mongodb-org-mongos-3.6.4 mongodb-org-tools-3.6.4

When you install the packages, you choose whether to install the current release or a previous one. This step provides the commands for both.

Start MongoDB.

You can start the mongod process by issuing the following command:

sudo service mongod start
Wick answered 6/5, 2018 at 11:23 Comment(0)
E
1

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.

Epistemology answered 19/11, 2018 at 6:43 Comment(0)
E
1

Hello Friend i will resoled problem

First Clean old data

sudo yum erase $(rpm -qa | grep mongod)
sudo rm -rf /etc/yum.repos.d/mongod*
sudo yum clean all

again create repo file new

/etc/yum.repos.d/mongodb-enterprise-4.4.repo 

file so that you can install MongoDB enterprise directly using yum:

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

Install MongoDB Enterprise 4.4. Issue the following command:

sudo yum install -y mongodb-enterprise

Install a specific release of MongoDB Enterprise. To install a specific release, you must specify each component package individually along with the version number, as in the following example:

sudo yum install -y mongodb-enterprise-4.4.1 mongodb-enterprise-server-4.4.1 mongodb-enterprise-shell-4.4.1 mongodb-enterprise-mongos-4.4.1 mongodb-enterprise-tools-4.4.1

If you only install mongodb-enterprise=4.4.1 and do not include the component packages, the latest version of each MongoDB package will be installed regardless of what version you specified.

Pin a specific version of MongoDB Enterprise. Although you can specify any available version of MongoDB Enterprise, yum upgrades the packages when a newer version becomes available. To prevent unintended upgrades, pin the package by adding the following exclude directive to your /etc/yum.conf file:

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

By default, MongoDB runs using the mongod user account and uses the following default directories:

/var/lib/mongo (the data directory)
/var/log/mongodb (the log directory)

➤ If you installed via the package manager, The default directories are created, and the owner and group for these directories are set to mongod.

➤ If you installed by downloading the tarballs, The default MongoDB directories are not created. To create the MongoDB data and log directories:

sudo mkdir -p /var/lib/mongo
sudo mkdir -p /var/log/mongodb

sudo systemctl daemon-reload

sudo systemctl start mongod

Any Error Come than ones Clean old

Option:- not create socket file than /tmp in old socket file remove

sudo systemctl daemon-reload
    
sudo systemctl start mongod

sudo service mongod status

more info to read https://docs.mongodb.com/manual/tutorial/install-mongodb-enterprise-on-red-hat/

https://www.mysterydata.com/how-to-install-mongodb-4-0-on-centos-7-rhel-7/

Eyla answered 6/10, 2020 at 12:15 Comment(0)
H
0

@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.

Hulbert answered 13/7, 2016 at 2:5 Comment(1)
yum-config-manager --add-repo repo.mongodb.org/yum/redhat/mongodb-org.repo --> Could not fetch/save url repo.mongodb.org/yum/redhat/mongodb-org.repo to file /etc/yum.repos.d/mongodb-org.repo: [Errno 14] HTTP Error 404 - Not FoundLabana
D
0

Create a mongodb-org.repo file sudo vi /etc/yum.repos.d/mongodb-org.repo

Add following content
[mongodb-org-3.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-
org/3.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc
Then execute sudo yum install mongodb-org

Reference:docs.mongodb.com/manual/tutorial/install-mongodb-on-red-hat/

Dior answered 7/7, 2017 at 20:30 Comment(0)
R
0

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

Reclamation answered 9/11, 2018 at 10:51 Comment(0)
M
0

Check and remove old version mongodb

yum list installed mongodb.x86_64
yum remove mongodb.x86_64

It helps

Mandymandych answered 24/7, 2020 at 5:46 Comment(0)
E
0

Hello Friend i will resoled problem

First Clean old data

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

again create repo file new

/etc/yum.repos.d/mongodb-enterprise-4.4.repo 

file so that you can install MongoDB enterprise directly using yum:

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

Install MongoDB Enterprise 4.4. Issue the following command:

sudo yum install -y mongodb-enterprise

Install a specific release of MongoDB Enterprise. To install a specific release, you must specify each component package individually along with the version number, as in the following example:

sudo yum install -y mongodb-enterprise-4.4.1 mongodb-enterprise-server-4.4.1 mongodb-enterprise-shell-4.4.1 mongodb-enterprise-mongos-4.4.1 mongodb-enterprise-tools-4.4.1

If you only install mongodb-enterprise=4.4.1 and do not include the component packages, the latest version of each MongoDB package will be installed regardless of what version you specified.

Pin a specific version of MongoDB Enterprise. Although you can specify any available version of MongoDB Enterprise, yum upgrades the packages when a newer version becomes available. To prevent unintended upgrades, pin the package by adding the following exclude directive to your /etc/yum.conf file:

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

By default, MongoDB runs using the mongod user account and uses the following default directories:

/var/lib/mongo (the data directory)
/var/log/mongodb (the log directory)

➤ If you installed via the package manager, The default directories are created, and the owner and group for these directories are set to mongod.

➤ If you installed by downloading the tarballs, The default MongoDB directories are not created. To create the MongoDB data and log directories:

sudo mkdir -p /var/lib/mongo
sudo mkdir -p /var/log/mongodb

sudo systemctl daemon-reload

sudo systemctl start mongod

Any Error Come than ones Clean old

Option:- not create socket file than /tmp in old socket file remove

sudo systemctl daemon-reload
    
sudo systemctl start mongod

sudo service mongod status
Eyla answered 6/10, 2020 at 12:13 Comment(0)
A
-1

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.

Achromat answered 5/5, 2017 at 19:24 Comment(1)
This does not currently work --- you'll get: repo.mongodb.org/yum/redhat/7/mongodb-org/stable/x86_64/…: [Errno 14] HTTPS Error 404 - Not Found Trying other mirror. To address this issue please refer to the below knowledge base articleStrasbourg
H
-1

Follow the below steps to install MongoDB on CentOS

  1. Add MongoDB yum repository
# vi /etc/yum.repos.d/mongodb.repo
  1. Enter i and paste the below lines in the file
[MongoDB]
name=MongoDB Repository
baseurl=http://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.0/x86_64/
gpgcheck=0
enabled=1

Press esc to save the vim file then enter :wq to quit the saved file.

3.Install MongoDB server

yum install mongodb-org
  1. Start MongoDB Service
# systemctl start mongod.service    # For CentOS 7 
# service mongod restart            # For CentOS 6/5 
  1. Check Mongod version
mongod --version

Referance: Installing MongoDB on CentOS

His answered 19/10, 2019 at 20:29 Comment(2)
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From ReviewBeech
Thanks for the review. I have updated the answer and provided the necessary information.His

© 2022 - 2024 — McMap. All rights reserved.