How to uninstall Mongo Shell via homebrew


I was trying out MongoDB Atlas and was lead by the wizard to install the Mongo Shell via the Homebrew script “brew install mongodb/brew/mongodb-community-shell”.

May I ask how do I uninstall the MongoDB shell? Is there another shell for uninstalling?

I tried to search the internet and MangoDB FAQ but I can hardly find much information about Mango Shell. All the results are more for the DB than the shell!

Welcome to the MongoDB community @Stan_Suen!

Use brew uninstall instead of brew install. Either of these should work:

brew uninstall mongodb/brew/mongodb-community-shell

brew uninstall mongodb-community-shell

For more options see brew help and brew help uninstall.



I actually did the “brew uninstall …” statement first before I reach for help. The reason was that the uninstallation only deleted the download package and did not seems to clean up all the long list of stuff /usr/local/bin or /usr/local/var. So out of curiosity I try to “reinstall” Mongo Shell again with the “brew install” again. Only that the second time brew did not work and came up with a

Warning: mongodb/brew/mongodb-community-shell 4.2.0 is already installed and up-to-date
To reinstall 4.2.0, run brew reinstall mongodb-community-shell

So I thought the uninstallation process only deleted the download packages but did not do a real uninstall of mongo shell. It’s no big deal to leave mongo shell in my system but I am very curious in how to properly clean it up. Homebrew does a great job in spoiling people like me not to understand how things work underneath. :slight_smile: