Skip to content

Instantly share code, notes, and snippets.

@bhagatparwinder
Created October 10, 2017 19:29
Show Gist options
  • Save bhagatparwinder/1dd557f26bd0cc13ffa3c134fecb0e5e to your computer and use it in GitHub Desktop.
Save bhagatparwinder/1dd557f26bd0cc13ffa3c134fecb0e5e to your computer and use it in GitHub Desktop.
Remove mongodb that was installed by brew
#!/usr/bin/env sh
# checks to see if running
launchctl list | grep mongo
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist
launchctl remove homebrew.mxcl.mongodb
pkill -f mongod
rm -f ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist
brew uninstall mongodb
# double check existence
ls -al /usr/local/bin/mong*
ls -al ~/Library/LaunchAgents
# remove additonal directories
rm -rf /usr/local/var/mongodb
rm -r /data/db/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment