Reload local package database.Issue the following command to reload the local package database:$ sudo apt-get update

Install the MongoDB packages.To install the latest stable version of MongoDB, issue the following command:$ sudo apt-get install -y mongodb-org

Start MongoDB.Issue the following command to start mongod:$ sudo service mongod start

Verify that MongoDB has started successfully.Verify that the mongod process has started successfully by checking the contents of the log file at /var/log/mongodb/mongod.log for a line reading[thread1] waiting for connections on port <port>where <port> is the port configured in /etc/mongod.conf, 27017 by default.