How to uninstall homebrew?

烈酒焚心 提交于 2019-12-06 07:03:10

This is covered in the homebrew FAQ:

https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/FAQ.md#how-do-i-uninstall-homebrew

It specifies a script you can run to do it. You should run that script. As of right now, the script says something like:

#!/bin/sh
# Just copy and paste the lines below (all at once, it won't work line by line!)
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY!

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

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:

https://gist.github.com/SteveBenner/11254428

This worked for me

Official brew uninstalling steps:

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

But /usr/bin/ruby is just symlink in order to find your ruby you need to type

which ruby

Which will give you /snap/bin/ruby

So then just use this :

/snap/bin/ruby  -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!