sudo apt-get purge mongodb-org*
Just start with here .
If you do not want 3.2, do not
sudo apt-get install -y mongodb-org
Define the version for all individual components in the next step.
OR you can copy the correct version link from mongodb .
You need
cd /Downloads wget wget https://fastdl.mongodb.org/linux/mongodb-correct-version.tgz tar -zxvf mongodb-correct-version.tgz
You should see all the executables. Make sure / usr / local / bin is in your PATH
echo $PATH
Create a symlink for the mongod server and check the version.
sudo ln -s ~/Downloads/mongodb-correct-version/bin/mongod /usr/local/sbin/bin/mongod mongod --version
Now create a symlink for the shell and check the version.
sudo ln -s ~/Downloads/mongodb-correct-version/bin/mongo /usr/local/bin/mongo mongo --version
Create a directory path for the server.
mkdir ~/data mkdir ~/data/db
Start the server and let it start from a separate terminal, except for the shell.
mongod --dbpath ~/data/db/
It should listen on port 27017. In the new terminal, start mongo.
mongo
source share