Skip to content

Instantly share code, notes, and snippets.

@nickvoronin
Last active October 12, 2018 11:13
Show Gist options
  • Select an option

  • Save nickvoronin/cb0ccd763d0976a110e23e24afa0d02c to your computer and use it in GitHub Desktop.

Select an option

Save nickvoronin/cb0ccd763d0976a110e23e24afa0d02c to your computer and use it in GitHub Desktop.
# Locate
which mongo
locate -b '\mongo'
# Start
sudo service mongod start
# On start error
# Failed to start mongod.service: Unit mongod.service not found.
sudo systemctl unmask mongodb
# Check status
systemctl status mongodb.service
# change dbPath
/etc/mongod.conf
mongod --config /etc/mongod.conf
If you run ps -xa | grep mongod and you don't see a --dbpath which explicitly tells mongod to look at that
parameter for the db location and you don't have a dbpath in your mongodb.conf, then the default location
will be: /data/db/ and you should look there.
# Remove
sudo service mongod stop
sudo apt-get purge mongodb-org*
sudo rm -r /var/log/mongodb
sudo rm -r /var/lib/mongodb
# OR
Normally, with apt command, you can launch autoremove with all mongoDB packages :
sudo apt-get autoremove mongodb-*
https://askubuntu.com/questions/990727/error-removing-broken-mongo-server-package
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment