20

I want to install Mongo 3.2 on Ubuntu 15.10.

The official mongodb site gives steps up to 14.04.

On the other hand, using the normal ppa from Ubuntu uses the 2.6 version (which is kinda way too back).

KhoPhi
  • 1,888
  • I'm fairly certain those instructions will work fine. – TheWanderer Jan 23 '16 at 19:42
  • @Zacharee1 I tried the mongodb site instructions, couldn't find the ppa in ubuntu 15.10 repositories. – KhoPhi Jan 23 '16 at 19:44
  • Try this: https://gist.github.com/sgnn7/54146c8a13c8b5ca2201 – TheWanderer Jan 23 '16 at 19:46
  • I wish I understood how the script gets to install the 3.2 as I don't see anywhere in it which installs the 3.2. I don't already have the 3.2 installed. Currently, 2.6 is installed, but I want the 3.2 instead. – KhoPhi Jan 23 '16 at 19:50
  • OK. Try adding the 14.04 repo as it is (don't change it to Vivid). Then run that script and see if you can start Mongo – TheWanderer Jan 23 '16 at 19:53
  • Actually, does this work? http://www.liberiangeek.net/2015/06/how-to-install-mongodb-in-ubuntu-15-04-easily/ – TheWanderer Jan 23 '16 at 19:55
  • Thanks for the link. @Zacharee1 That gets me to install 3.0. I'm looking for 3.2 – KhoPhi Jan 23 '16 at 20:15
  • Change "$(lsb_release -sc)"/mongodb-org/3.0 multiverse" to "$(lsb_release -sc)"/mongodb-org/3.2 multiverse" – TheWanderer Jan 23 '16 at 20:16
  • I did that, obviously, but got these: W: Failed to fetch http://repo.mongodb.org/apt/ubuntu/dists/wily/mongodb-org/3.2/multiverse/binary-amd64/Packages 404 Not Found W: Failed to fetch http://repo.mongodb.org/apt/ubuntu/dists/wily/mongodb-org/3.2/multiverse/binary-i386/Packages 404 Not Found – KhoPhi Jan 23 '16 at 20:17
  • 1
    OK. Replace sudo echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.0 multiverse" with echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse". – TheWanderer Jan 23 '16 at 20:21
  • @Zacharee1 Got 3.2 to install, but can't start. mongod complains of /data/db not found, and mongo complains of inability to connect. I guess its about time I run the script? – KhoPhi Jan 23 '16 at 21:07
  • 1
    Yeah. Try it out – TheWanderer Jan 23 '16 at 21:07
  • Nice! Glad it works – TheWanderer Jan 23 '16 at 21:46

3 Answers3

33

Thanks to @Zacharee1, I got 3.2 of Mongo installed on Ubuntu 15.10. Below are the steps taken from LiberianGeek (changed just the version to match 3.2)

Add Key

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

Add Sources List

echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list

Update your sources

sudo apt-get update

Install mongodb-org

sudo apt-get install mongodb-org

Check if working

sudo systemctl status mongod

If not working

sudo reboot

If still not working

At the time of writing this, I had Mongo 3.2.1.

Working example. Mongo 3.2.1 on Ubuntu 15.10

KhoPhi
  • 1,888
9

Following the above steps, I got a public key is not available: NO_PUBKEY error

In case this happens to anyone else, I resolved it with:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv EA312927
muru
  • 197,895
  • 55
  • 485
  • 740
adam
  • 91
  • 1
    That's surprising though to me, 'cause I tried the apt-key from my answer, and it still exists. – KhoPhi Jan 31 '16 at 22:28
  • I had the same issue, I did what @adam suggested, it worked. Thanks guys! – biphobe Apr 02 '16 at 12:12
  • I also had this issue, but what worked was adding the key referenced in the error message (e.g. http://askubuntu.com/a/141088/430924) – D Schlachter Apr 11 '16 at 19:07
4

For Mongo v3.0 and before you should use this key:

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

https://docs.mongodb.org/v3.0/tutorial/install-mongodb-on-ubuntu/

For Mongo v3.2 the key has an update:

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

https://docs.mongodb.org/v3.2/tutorial/install-mongodb-on-ubuntu/

techraf
  • 3,316
Yulai
  • 41