when I put mongo command on terminal it gives me error like

mongo: error while loading shared libraries: libmozjs.so: cannot open shared object file: No such file or directory


i guess you installed mongodb by this command :

 sudo apt-get install mongodb

if then try this

sudo apt-get --purge remove mongodb
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
sudo apt-add-repository \
"deb http://downloads.mongodb.org/distros/ubuntu 10.4 10gen"
sudo apt-get update
sudo apt-get install mongodb-snapshot

Here is a nice tutorial about Getting started with MongoDB under Ubuntu

Hope this helps.

UPDATE: This bug is fixed in the version 1:1.2.2-1ubuntu1.1. see the bug entry.
You can download it here. 1:1.2.2-1ubuntu1.1


This sounds like you simply downloaded mongodb tarball and installed it without all of the dependencies.

You should either download the deb file or setup apt to get the deb from the 10gen repos. See here.

Your error is most likely due to the fact that you're missing the xulrunner package, which is part of the mozilla/firefox stuff. Mongo uses the javascript engine that is part of firefox.

One note: due to the fact that mongo depends on xulrunner, xulrunner depends on lots of other things, be prepared to install lots of seemingly unnecessary packages to get mongo running.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.