4

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?

5

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
    
  • Sadly there are no stretch packages. How can I install mongodb 3.4 on debian 9 (stretch)? – Hamburml Jul 15 '17 at 13:27
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

  • 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 4 '16 at 6:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.