Daniela Morais
Daniela Morais

Reputation: 2247

Why I can't install a specific version of MongoDB?

I want install mongoDB 2.6.6, i follow this tutorial (http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/)

daniela.morais@tusk:/var/lib$ sudo apt-get install -y mongodb-org=2.6.6 mongodb-org-server=2.6.6 mongodb-org-shell=2.6.6 mongodb-org-mongos=2.6.6 mongodb-org-tools=2.6.6
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Version '2.6.6' for 'mongodb-org' was not found
E: Version '2.6.6' for 'mongodb-org-server' was not found
E: Version '2.6.6' for 'mongodb-org-shell' was not found
E: Version '2.6.6' for 'mongodb-org-mongos' was not found
E: Version '2.6.6' for 'mongodb-org-tools' was not found

Upvotes: 7

Views: 11556

Answers (2)

kal
kal

Reputation: 170

To install mongodb 2.6 you'll need to follow this tutorial: http://docs.mongodb.org/v2.6/tutorial/install-mongodb-on-ubuntu

After adding the public key,

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10

the differentiating step is adding this source:

echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list

Then you can install 2.6 with

sudo apt-get update
sudo apt-get install -y mongodb-org

When I ran this installation on Ubuntu I get 2.6.8. You can check by using

mongod --version

Upvotes: 6

neuhaus
neuhaus

Reputation: 4104

If you enter apt-cache show <pkgname> it will give you a list of versions that are available form your package repository.

Try: apt-cache show mongodb-org.

If you enter apt-cache show mongodb-org | grep Version it will show you only the version numbers.

If you get "E: No packages found", you need to create the file /etc/apt/sources.list.d/mongodb-org-3.0.list as described on the page you linked first, then run sudo apt-get update.

Upvotes: 1

Related Questions