Ubuntu – MongoDB 2.6 does not start on Ubuntu 15.04


I installed MongoDB 2.6 on clean installed Ubuntu 15.04:

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 -y mongodb-org

It finished without any problems.
However, when I tried to start it, I got the following error:

$ sudo service mongod start
Failed to start mongod.service: Unit mongod.service failed to load: No such file or directory.

How can I fix this?

Best Answer

I installed from the debian wheeze repository and it works fine.

First make sure you remove the mongodb-org package and all its dependencies:

sudo apt-get purge mongodb-org
sudo apt-get autoremove

Remove the old mongodb.list you created:

sudo rm /etc/apt/sources.list.d/mongodb.list

Use the Debian repository instead:

echo "deb http://repo.mongodb.org/apt/debian wheezy/mongodb-org/3.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list

Update and install again:

sudo apt-get update
sudo apt-get install -y mongodb-org

After that, you can succesffully start the server:

sudo service mongod start


systemctl start mongod

(as clarified by Ernie Hershey in reply to Roman Gaufman's comment here: https://jira.mongodb.org/browse/SERVER-17742)