setup
-
systemd
toupstart-sysv
# ubuntu 15.04 advanced the default init system # from `upstart` to systemd # switch back to `upstart` $ sudo apt-get install upstart-sysv $ sudo reboot
-
install
# 1. import public key $ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 # 2. create a list file for mongodb $ sudo 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 # 3. reload local package database $ sudo apt-get update # 4. install sudo('apt-get install -y mongodb-org')
-
service
$ sudo service mongod start
-
# 1. stop mongodb $ sudo service mongod stop # 2. remove package $ sudo apt-get purge mongodb-org* # 3. remove data directories $ sudo rm -r /var/log/mongodb $ sudo rm -r /var/lib/mongodb