Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've got some problems with this package manager. I can't find how to remove it!

Is it safe to remove whole /usr/local? Homebrew was installed somewhere in that directory.

share|improve this question
add comment

5 Answers

up vote 105 down vote accepted

Here's how they recommend doing it:

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

This should also revert your /usr/local folder to its pre-Homebrew days. See the Homebrew installation wiki for more information.

Edit: Updated the uninstall code to the latest version in the FAQ.

Note: You may also need to remove ~/.homebrew as well. If you happen to have ~/.rvm then you should delete ~/.rvm/bin/brew.

share|improve this answer
thank you so much! i've googled so hard, but even't bothered to look for uninstallation actions in installation manual! ;D –  holms Oct 28 '10 at 15:36
Note that the instructions have changed over time, and also been moved to the Homebrew FAQ github.com/mxcl/homebrew/wiki/FAQ/… –  Nelson Sep 10 '11 at 23:19
stackoverflow.com/questions/18282363/… –  Ava Aug 16 '13 at 21:27
Following these commands deleted almost all my files on Desktop, Documents and 'Downloads`. It messed up my git too. Please help! –  Ava Aug 16 '13 at 22:53
rm -rf Library/Taps –  Googol Mar 13 at 13:25
show 2 more comments

Also note that homebrew changes group to 'staff' and gives write access to group for

  • /usr/local
  • /usr/local/bin
  • /usr/local/include
  • /usr/local/lib
  • /usr/local/sbin
  • /usr/local/share

In order to put back these directories in their original states do:

sudo chown root:wheel <directory> ; sudo chmod 755 <directory>

for each one or if you don't have fancy owners / rights:

sudo chown -R root:wheel /usr/local ; sudo chmod -R 755 /usr/local
share|improve this answer
I cannot confirm this. My /usr/local and its Homebrew-created subdirs are owned by my user with the admin group. –  slhck Dec 26 '12 at 16:21
add comment

Try this gist, it uninstalls homebrew and associated caches, provided you installed brew to the default directory.

share|improve this answer
add comment

There might be other files in /usr/local you might need you might be able to user a different PM to remove the current PM.

share|improve this answer
I'm unclear as to what this answer means. What's a PM? –  echristopherson May 16 '13 at 4:00
add comment

I recently made a script to handle this case - it completely removes Homebrew, and has CLI options like silent/verbose and force modes, as well as mode that returns the location of your Homebrew installation: https://gist.github.com/SteveBenner/11254428

share|improve this answer
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.