Reputation: 360
I have yet to find a solution to the problem of installing a specific release of MongoDB. I've found several SO posts and other resources, to no avail. The official docs say:
sudo apt-get install -y mongodb-org=3.0.12 mongodb-org-server=3.0.12 mongodb-org-shell=3.0.12 mongodb-org-mongos=3.0.12 mongodb-org-tools=3.0.12
But I get error messages saying those versions are not found. I've tried previous versions as well, but I get the same error output.
Upvotes: 20
Views: 45039
Reputation: 698
go to the guide page.
follow the guide of that version on page, then it's done.
Upvotes: 9
Reputation: 636
Well, I think it's not recommend to install previous version package by package manager like apt or yum, which may break package dependency relation.
MongoDB legacy version (tgz package for all linux distributions) can be a good choice.
All legacy history package can be found here:
https://www.mongodb.org/dl/linux/x86_64
You can install some legacy version by:
wget -c "https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-A.B.C.tgz"
just replace A.B.C with the version you want to install.
unpack it:
tar -zxvf mongodb-linux-x86_64-A.B.C.tgz
run mongodb server:
'./mongodb-linux-x86_64-A.B.C/bin/mongod'
Upvotes: 2
Reputation: 339
Refer to Official mongodb administration 'Install on linux' documentation.
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
sudo apt-get update
sudo apt-get install -y mongodb-org=3.0.12 mongodb-org-server=3.0.12 mongodb-org-shell=3.0.12 mongodb-org-mongos=3.0.12 mongodb-org-tools=3.0.12
Do it only if you don't want to accidentally upgrade mongo with apt-get
echo "mongodb-org hold" | sudo dpkg --set-selections &&
echo "mongodb-org-server hold" | sudo dpkg --set-selections &&
echo "mongodb-org-shell hold" | sudo dpkg --set-selections &&
echo "mongodb-org-mongos hold" | sudo dpkg --set-selections &&
echo "mongodb-org-tools hold" | sudo dpkg --set-selections
Upvotes: 24
Reputation: 3374
Before installing, you have to update the list files (repos). Check below link for more
https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/
Upvotes: 1