5

I want to install mongodb in debian jessie, but debian repo only has mongodb 2.4 and I need mongodb 3.x.

Mongodb web page instructions for installing latest mongodb in debian only supports wheezy.

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
echo "deb http://repo.mongodb.org/apt/debian wheezy/mongodb-org/3.2 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list
sudo apt-get update
sudo apt-get install -y mongodb-org

Can I install it this way despite being for wheezy or would it be better to install it from the tar.gz and deal with unmet dependencies by hand?

Faheem Mitha
  • 34,649
  • 32
  • 119
  • 183

2 Answers2

6

You can follow the instructions in the MongoDB official site

  • first, import the MongoDB public GPG Key

    sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
    
  • add a source.list configuration file

Debian 7 (wheezy)

echo "deb http://repo.mongodb.org/apt/debian wheezy/mongodb-org/3.2 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list    

Debian 8 (jessie)

echo "deb http://repo.mongodb.org/apt/debian jessie/mongodb-org/3.2 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list
  • reload aptitude cache

    sudo apt-get update
    
  • and finally install the desired version of MongoDB

    sudo apt-get install -y mongodb-org=3.2.10 mongodb-org-server=3.2.10 mongodb-org-shell=3.2.10 mongodb-org-mongos=3.2.10 mongodb-org-tools=3.2.10
    
riman
  • 76
  • 1
  • 3
1

Install the version 2.4 by using the command apt-get install mongodb and after that use the command:

sudo apt-get install -y mongodb-org=3.0.1 mongodb-org-server=3.0.1 mongodb-org-shell=3.0.1 mongodb-org-mongos=3.0.1 mongodb-org-tools=3.0.1

worked for me now i have mongodb 3.0.1 in debian jessie 8.4

Anthon
  • 78,313
  • 42
  • 165
  • 222
gani amine
  • 31
  • 3
  • Able to install 2.4 with apt-get install mongodb, and than when I executed sudo apt-get install -y mongodb-org=3.0.1 mongodb-org-server=3.0.1 mongodb-org-shell=3.0.1 mongodb-org-mongos=3.0.1 mongodb-org-tools=3.0.1 it says "unable to locate package" – Naga Aug 04 '16 at 06:59