Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
626 views
in Technique[技术] by (71.8m points)

macos - What is the best/safest way to reinstall Homebrew?

I am getting issues with permissions in Homebrew: After I installed Node and tried to install npm using the curl command Homebrew tells you to use, it would fail due to EACCESS errors. I checked the node folder and the permissions were a) unowned by a user (I had to chown it) and b) Had no write permissions (I had to chmod 755 it).

I've fixed the issue with NPM, but I had to run its install script as sudo (which is bad!).

I assume I must have installed Homebrew as root or something similar. I am hoping that reinstallation will fix it, but I can't find a source on how to reinstall Homebrew.

When I rerun the installer in Terminal I get:

/usr/local/.git already exists!
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Update 10/11/2020 to reflect the latest brew changes.

Brew already provide a command to uninstall itself (this will remove everything you installed with Homebrew):

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"

If you failed to run this command due to permission (like run as second user), run again with sudo

Then you can install again:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...