Skip to content

Instantly share code, notes, and snippets.

@nitschmann
Created December 10, 2013 09:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nitschmann/7887860 to your computer and use it in GitHub Desktop.
Save nitschmann/7887860 to your computer and use it in GitHub Desktop.
Uninstaller for HomeBrew
#!/bin/sh
# This script uninstalls HomeBrew from your Mac completly
# Just copy and paste the lines below (all at once, it won't work line by line!)
function abort {
echo "$1"
exit 1
}
set -e
/usr/bin/which -s git || abort "brew install git first!"
test -d /usr/local/.git || abort "brew update first!"
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
@nitschmann
Copy link
Author

curl -L https://gist.githubusercontent.com/fnitschmann/7887860/raw/uninstall_homebrew.sh | sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment