2

I'm running Ubuntu 14.04 and am trying to install MongoDB.

Per http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/ I do sudo apt-get install mongodb-org and this is the output I get:

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package mongodb-org

So how do I install mongodb? Is compiling from source my only option?

neubert
  • 211
  • 1
  • 8
  • 15

2 Answers2

3

Using ALL the commands below, command by command

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/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

Source

A.B.
  • 90,397
2

This command worked for me

sudo apt-get install -y mongodb 
Hira Kh
  • 21
  • 1
  • 2
    I'd love the delete-voters to justify their votes with comments. This answer isn't inaccurate; it installs MongoDB. The caveat is it'll install version 2.4.9 (current is 3.4.6). 2.4 left upstream support back in 2016 so unless other people (its Ubuntu maintainer, or Debian) have been patching it, it's likely not the best option. – Oli Jul 24 '17 at 08:34