It's possible, that MongoDB doesn't start if you use the Trusty packages:
Failed to start mongod.service: Unit mongod.service failed to load: No such file or directory.
In this case, install the Debian Wheezy packages as described at the end.
Install the Trusty DEB packages
Download the DEB files
cd
wget http://repo.mongodb.org/apt/ubuntu/dists/trusty/mongodb-org/3.0/multiverse/binary-amd64/mongodb-org-mongos_3.0.3_amd64.deb
wget http://repo.mongodb.org/apt/ubuntu/dists/trusty/mongodb-org/3.0/multiverse/binary-amd64/mongodb-org-server_3.0.3_amd64.deb
wget http://repo.mongodb.org/apt/ubuntu/dists/trusty/mongodb-org/3.0/multiverse/binary-amd64/mongodb-org-shell_3.0.3_amd64.deb
wget http://repo.mongodb.org/apt/ubuntu/dists/trusty/mongodb-org/3.0/multiverse/binary-amd64/mongodb-org-tools_3.0.3_amd64.deb
wget http://repo.mongodb.org/apt/ubuntu/dists/trusty/mongodb-org/3.0/multiverse/binary-amd64/mongodb-org_3.0.3_amd64.deb
And install with (in this order)
sudo dpkg -i mongodb-org-server_3.0.3_amd64.deb
sudo dpkg -i mongodb-org-tools_3.0.3_amd64.deb
sudo dpkg -i mongodb-org-shell_3.0.3_amd64.deb
sudo dpkg -i mongodb-org-mongos_3.0.3_amd64.deb
sudo dpkg -i mongodb-org_3.0.3_amd64.deb
And taken from the comments, thank you @Pilot6:
They may have dependencies to each other. That's why installation
packages one by one may give errors. I suggest sudo dpkg -i mongodb*.deb
Use the Trusty PPA
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
sudo apt-get update
sudo apt-get install -y mongodb-org
Use the Debian Wheezy packages
It's possible, that MongoDB doesn't start if you use the Trusty packages:
Failed to start mongod.service: Unit mongod.service failed to load: No such file or directory.
In this case, install the Debian Wheezy packages as described below
sudo apt-get remove mongodb-org
sudo apt-get autoremove
sudo rm /etc/apt/sources.list.d/mongodb-org-3.0.list
sudo 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
sudo apt-get update
sudo apt-get install -y mongodb-org
Looks like it is fairly straightforward to use the older version under Xenial and a big 'thanks' to Cory Goldberg for this information. I have modified Cory's method in quite a few places:
Remove any existing version of conky:
sudo apt-get remove --purge conky-std conky-all
Download the older version of the conky-all
package:
wget http://security.ubuntu.com/ubuntu/pool/universe/c/conky/conky-all_1.9.0-6build1_amd64.deb
Install with gdebi:
sudo apt-get install gdebi
sudo gdebi conky-all_1.9.0-6build1_amd64.deb
Lock or pin your older version to prevent the Repository installing the newer version next time you update:
sudo apt-mark hold conky-all
And then enjoy your older version of conky :)
Below is a screenshot of the 'pinned' older version of Conky on Xenial, seen in my old friend Synaptic, the exclamation mark signifying that the package is 'pinned':
References:
Best Answer
It's a bit of a hack but yes, this can be done. There is an undocumented step needed to actually start the service and (weirdly enough) unless you want to futz around with upstart job conversion manually, you need to install the Ubuntu
mongodb
package first, then remove it so that you have a usable service. A straight install of the MongoDB packages will not give you a working service on a fresh 16.04.Update - July 2016: The official fix for this (adding support for 16.04 to the packages) has been completed in the 3.3 dev branch as part of SERVER-23043 - and has been released as a backport in the 3.2 series as part of 3.2.7. Hence, if you are using 3.2.7+ you do not need to do this and the official MongoDB package install should just work.
In any case, after doing the add/remove, follow the usual instructions for 14.04, summarized here:
The install succeeds, and thanks to the Ubuntu package we have all the pieces needed for a service, but attempting to start the service will initially fail:
Fixing this is not too hard:
Now we can enable/start the service, get its status etc.
Success - and we get a nice pointer to the active config file (which is in the old
key=value
format, see here for examples in the newer recommended YAML format).Note: There will actually be two config files
/etc/mongod.conf
and/etc/mongodb.conf
thanks to slight differences between the two packages we have installed. The now-active service points to the old-format one by default/etc/mongodb.conf
- you can switch by moving/copying themongod.conf
tomongodb.conf
if you so wish, or simply edit the file directly.Once started, to test, connect to the database with the
mongo
shell:If you wish to get rid of the THP warnings, check out this answer.