How to upgrade MongoDB (2.4 to 2.6) on Ubuntu 14.04

May 4, 2015 7.8k views

Since I've installed MongoDB per this procedure: https://www.digitalocean.com/community/tutorials/how-to-deploy-a-meteor-js-application-on-ubuntu-14-04-with-nginx

Which did:

apt-get install mongodb-server

I'm curious about the proper upgrade procedure.

MongoDB.org says this:

apt-get install mongodb-org

Should the old be removed and the new installed or will "apt-get install mongodb-org" handle all of that?

NOTE: I've even tried apt-get upgrade mongo-server which tells me I'm at the latest version (2.4.9). Is it possible I need to add a new/different apt-get package repository for mongo 2.6?

1 Answer

The instructions in that tutorial will install MongoDB from the regular Ubuntu repository. In order to provide a stable environment, Ubuntu and other distros release with a specific versions of software. Often they will provide backported security patches and bugfixes, but they will not ship new major releases.

You can install a more recent version of MongoDB using upstream's repository:

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
sudo apt-get update
sudo apt-get install mongodb-org

Installing the mongodb-org packages will automatically remove the Ubuntu mongodb-server ones.

by Daniel Speichert
Deploy a Meteor.js application on Ubuntu 14.04 with Nginx and MongoDB. This tutorial shows you how to build and deploy a production-ready version of your JavaScript application using the Meteor framework.
  • Thanks. I had just been trying a very similar procedure. Yours works great!

Have another answer? Share your knowledge.