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?
/var/log/syslog
, verifying the failed attempt then editing/etc/init/mongodb.conf
can also help if you are using a non-standard data directory, log directory, or user instance. – Eat at Joes Jul 10 '15 at 17:14purge
prompted for answer, the next pasted line (autoremove
) didn't get in. – Zlatko Sep 26 '15 at 11:55sudo service mongod start
so that this happens at boot time – Hotbelgo Nov 27 '15 at 07:54Also, @shashin, if you want to pin a version, you can follow the instructions here: https://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/#install-the-mongodb-packages
– Ajax Dec 18 '15 at 06:42