How to Uninstall and Remove Homebrew for Mac OSX

Posted on September 30, 2013

Need to uninstall Homebrew for Mac OSX? This quick guide will help you completely remove it (and all associated packages) from your system.

cd `brew --prefix`
rm -rf Cellar
brew prune
rm `git ls-files`
rm -r Library/Homebrew Library/Aliases Library/Formula Library/Contributions
rm -rf .git
rm -rf ~/Library/Caches/Homebrew

Please let me know if you have any issues!


  • allister whitehead says:

    yeah , lots!
    rm: Cellar: Permission denied
    why is permission denied, how can I change this?

  • Vinny Troia says:

    try using SUDO before the command.

  • Vikrant More says:

    i ran this bunch of code…but i can still see the brew executable and some other readme files in the usr/local folder…im not sure if the i’ve uninstalled homebrew successfully

  • Brou says:

    Warning: If you installed git via homebrew, this method won’t work.
    The second line -as mentioned- removes all installed packages (including git if you installed it via homebrew).
    My solution: Leaving git package (+ its 6 dependencies) installed on my computer. Which means :
    Execute: “brew install git”
    After “brew prune” and before “rm `git ls-files`”.
    This isn’t optimal, but enough for my cleanup objectives.

  • Stephen Benner says:

    I’ve written a script specifically for un-installing Homebrew, and in my opinion it is currently the best tool for the job.

    You can find it here.

Leave a Reply

Your email address will not be published.

Contact Us

Have a question? Send us a message. We'll get back to you soon.