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

May 4, 2015 16.4k views

Since I've installed MongoDB per this procedure:

Which did:

apt-get install mongodb-server

I'm curious about the proper upgrade procedure. 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:// --recv 7F0CEB10
echo 'deb 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.