Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

yum install mongodb 3.2 fails

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?

like image 854
slysid Avatar asked Jan 11 '16 15:01

slysid


4 Answers

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/

like image 64
Android Avatar answered Oct 22 '22 00:10

Android


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.

like image 23
slysid Avatar answered Nov 02 '22 15:11

slysid


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.

like image 17
Idos Avatar answered Nov 02 '22 16:11

Idos


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.

like image 6
nikolai.serdiuk Avatar answered Nov 02 '22 16:11

nikolai.serdiuk