Mondo db - fatal: libstdc++.so.6: open failed: No such file or directory

14
May
0

During installation of MondoDB on Centos5.11, I encountered this error when attempting to run mongo shell.

ld.so.1: mongo: fatal: libstdc++.so.6: open failed: No such file or directory

To fix this issue make sure you download the extra libraries so you don’t get any dependency issues.
Assuming I have installed mongodb in /home/bach/mongo

$ cd /home/bach/mongo/
$ curl -O http://downloads.mongodb.org.s3.amazonaws.com/sunos5/mongo-extra-64.tgz
$ tar -xvzf mongo-extra-64.tgz
$ rm mongo-extra-64.tgz

Then export the path to the library before launching the shell:

$ export LD_LIBRARY_PATH=/home/bach/mongo/mongo-extra-64

Then you will be able to launch the shell without issues:

$ bin/mongo
> db.foo.save( { a : 1 } )
> db.foo.find()
Filed under: Linux, MongoDB