Eric Eric - 2 months ago 61
Ruby Question

How to uninstall Homebrew cleanly?

I tried

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"


But I got errors

It appears Homebrew is already installed. If your intent is to reinstall you should do the following before running this installer again:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
The current contents of /usr/local are bin Cellar CONTRIBUTING.md etc Frameworks heroku Homebrew include lib n opt README README.md sbin share SUPPORTERS.md var .gitignore


So I tried

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
Failed to locate Homebrew!


So I tried

rm -rf /usr/bin/.git and chown username /usr/local


But still the same.
How can I fix this issue. I need to have a fresh start.
My final purpose is to update current ruby2.0 to 2.2

Answer

Consider reading the Homebrew FAQ.

Scroll down the 4th FAQ listing enumerating : How do I uninstall Homebrew ?


Alternatively, try running this and then run the uninstall procedure as mentioned above -

cd /usr/local
git init
git remote add origin https://github.com/Homebrew/homebrew
git pull origin master