Issues installing MongoDB in Cloud9 environment

Issues installing MongoDB in Cloud9 environment
0

#1

Hey,

I recently wanted to start the MongoDB tutorial, but I get stuck at the very beginning - I fail to install MongoDB. If I type

sudo apt-get install -y mongodb-org

I get the response

sudo: apt-get: command not found

So apparently apt-get isn’t a proper command for my C9 environment. I googled a bit and I reached this thread on StackOverflow: https://stackoverflow.com/questions/32592956/apt-get-command-not-found. Apparently the Amazon Linux seems to be CentOS based and thus doesn’t operate with the apt-get command but instead with the yum command. So I tried

sudo yum install -y mongodb-org

which gives me

Loaded plugins: priorities, update-motd, upgrade-helper
amzn-main | 2.1 kB 00:00:00
amzn-updates | 2.5 kB 00:00:00
1034 packages excluded due to repository priority protections
No package mongodb-org available.
Error: Nothing to do

So apparently there is no mongodb-org package. I tried yum search mongodb and got these results

Loaded plugins: priorities, update-motd, upgrade-helper
1034 packages excluded due to repository priority protections
===================================================================== N/S matched: mongodb ======================================================================
libmongodb.i686 : MongoDB shared libraries
libmongodb.x86_64 : MongoDB shared libraries
libmongodb-devel.i686 : MongoDB header files
libmongodb-devel.x86_64 : MongoDB header files
mongodb-server.x86_64 : MongoDB server, sharding server and support scripts
nodejs-mongodb.noarch : A node driver for MongoDB
golang-github-go-mgo-mgo-devel.i686 : The MongoDB driver for Go
golang-github-go-mgo-mgo-devel.x86_64 : The MongoDB driver for Go
mongodb.x86_64 : High-performance, schema-free document-oriented database
php-pecl-mongo.x86_64 : PHP MongoDB database driver
pymongo.x86_64 : Python driver for MongoDB
pymongo-gridfs.x86_64 : Python GridFS driver for MongoDB
python-mongoengine.noarch : A Python Document-Object Mapper for working with MongoDB
python-pymongo.x86_64 : Python driver for MongoDB
python-pymongo-gridfs.x86_64 : Python GridFS driver for MongoDB

Name and summary matches only, use “search all” for everything.

So I installed the mongodb package with sudo yum install -y mongodb. This worked and I can check the version with mongo --version, but mongod is still an unrecognized command and I can’t pass the first tutorial of learnyoumongo.

Now I’m pretty lost on what to do more. I hope some of you can bring me some clarity. I also saw this 2-year old post on the C9 community forum, but they suggest to use apt-get.

What am I doing wrong?

Thanks in advance already :slight_smile:


#2

I thought you should use npm install and you don’t need sudo (from what I remember) on Cloud9.

Note I was using the node environment.


#3

Hi,


I tried awhile back too and gave up, I think I ended up changing servers to get it working, but the challenge user stories were missing key words…

K


#4

You could try creating a mlab database and just linking to it.


#5

Thanks so much, this worked after I deinstalled the other MongoDB version I installed previously. Now going through the tutorials… :slight_smile: