Mr.D
Mr.D

Reputation: 7873

MongoDB does not install on CentOS 6.7

I'm Windows guy. When I need to use Linux based OS, I always choose Ubuntu. However, this time they didn't give me any choice.

I tried to install MongoDB from this link of mongodb site. I have created repository file then I try to install it and I get this error message:

Error: Package: mongodb-org-tools-3.2.1-1.amzn1.x86_64 (mongodb-org-3.2)
       Requires: libstdc++.so.6(CXXABI_1.3.5)(64bit)
Error: Package: mongodb-org-mongos-3.2.1-1.amzn1.x86_64 (mongodb-org-3.2)
       Requires: libstdc++.so.6(GLIBCXX_3.4.14)(64bit)
Error: Package: mongodb-org-shell-3.2.1-1.amzn1.x86_64 (mongodb-org-3.2)
       Requires: libstdc++.so.6(GLIBCXX_3.4.14)(64bit)
Error: Package: mongodb-org-server-3.2.1-1.amzn1.x86_64 (mongodb-org-3.2)
       Requires: libstdc++.so.6(CXXABI_1.3.5)(64bit)
Error: Package: mongodb-org-server-3.2.1-1.amzn1.x86_64 (mongodb-org-3.2)
       Requires: libstdc++.so.6(GLIBCXX_3.4.15)(64bit)
Error: Package: mongodb-org-shell-3.2.1-1.amzn1.x86_64 (mongodb-org-3.2)
       Requires: libstdc++.so.6(GLIBCXX_3.4.15)(64bit)

According to this message I thought that I'm missing libstdc++.so.6. So I have run this command to install it:

 yum install libstdc++.so.6

I got this message:

Package libstdc++-4.4.7-16.el6.i686 already installed and latest version

This is getting frustrating. Why this is happening?

Upvotes: 1

Views: 1587

Answers (2)

Markus W Mahlberg
Markus W Mahlberg

Reputation: 20703

You screwed up your repository definitions a bit. Either you actually do run CentOS, in which case you mistakenly defined the repository for the AmazonLinux packages of MongoDB. This is the more likely case, since I can reproduce your problem with that misconfigured repo.

There is a chance, however, that you run on AmazonLinux and defined the CentOS repositories.

If you are positively sure you are really on CentOS

The problem is that you entered the wrong repository. When using the correct repo, MongoDB installs and runs as expected. However, the RPM name is different, both as shown below:

Working setup

Most likely, you have put a wrong repo definition somehwere, like below:

Wrong repository

So, what you need to do is to find the place where the repository for Amazon Linux is defined and replace it with the correct one:

$ grep -l amazon -R /etc/yum.repos.d/*

The problem here is that multiple repositories might be defined. Inspect the files returned by the grep command, and remove the respective repository definition. Then, add the correct repository definition, which as of the time of this writing is

[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

If you are on AmazonLinux

Misconception

It has to be said that

AmazonLinux != CentOS

They are close (both based on RHEL), but not identical. Specifically, some package versions might differ. The package versions used to compile MongoDB for AmazonLinux are documented within the RPM, and this documentation is sort of a contract between the package and the system

I, MongoDB, promise to run properly on a system which has these packages in the specified version.

A contract which CentOS can not fulfill.

Solution

Simply follow the installation instructions for MongoDB on AmazonLinux.

Upvotes: 2

JVXR
JVXR

Reputation: 1312

Looks like the culprit is glibc can you try

yum list glibc

And see if the version matches what mongo expects. Welcome to dependency hell :)

Upvotes: 2

Related Questions