I’ve got some problems with the package manager, Homebrew. I can’t find how to remove it!
Is it safe to remove whole
/usr/local? Homebrew was installed somewhere in that directory.
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
Here is a copy of the old script, for historical purposes:
cd `brew --prefix` git checkout master git ls-files -z | pbcopy rm -rf Cellar bin/brew prune pbpaste | xargs -0 rm rm -r Library/Homebrew Library/Aliases Library/Formula Library/Contributions test -d Library/LinkedKegs && rm -r Library/LinkedKegs rmdir -p bin Library share/man/man1 2> /dev/null rm -rf .git rm -rf ~/Library/Caches/Homebrew rm -rf ~/Library/Logs/Homebrew 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.
Note: You may also need to remove
~/.homebrew as well. If you happen to have
~/.rvm, then you should delete
Homebrew now provides an uninstall script located here.
Just run the following in the OSX terminal:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
Also note that homebrew changes group to 'staff' and gives write access to group for
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
Try this gist, it uninstalls homebrew and associated caches, provided you installed brew to the default directory.
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.
There might be other files in
/usr/local you might need you might be able to user a different PM (Package Manager) to remove the current PM.
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?