解决brew时遇到的问题解决办法

263 阅读1分钟

1、updating homebrew...一直不动的情况

在终端执行

cd "$(brew --repo)"

git remote set-url origin https://mirrors.ustc.edu.cn/brew.git

cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"

git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git

cd 

brew update

此时不再出现updating homebrew...

亲测可用:blog.csdn.net/idomyway/ar…  

2、提示当前用户无权限安装,但是加了sudo又提示是危险操作  

Error: Running Homebrew as root is extremely dangerous and no longer supported. As Homebrew does not drop privileges on installation you would be giving all build scripts full access to your system.

解决方法:执行以下命令

$ sudo chown -R `whoami` /usr/local/Homebrew/
$ sudo chown -R $(whoami) $(brew --prefix)/*
$ sudo mkdir /usr/local/Frameworks
$ sudo chown -R `whoami` /usr/local/Frameworks/