yum install mongodb 3.2 fails

slysid picture slysid · Jan 11, 2016 · Viewed 19.8k times · Source

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?

Answer

Idos picture Idos · Jan 11, 2016

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.