Homebrew,你TM快點行不行

如果已經安裝過brew,可以重新安裝brew

#卸載brew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"

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

确保自己有/usr/local目录的权限,如果没有,可以使用如下指令

sudo chown -R 你的用户名 /usr/local/

更換鏡像源

cd /usr/local
#清华镜像源
git remote set-url origin git://mirrors.tuna.tsinghua.edu.cn/homebrew.git
#中科大镜像源
git remote set-url origin http://mirrors.ustc.edu.cn/homebrew.git
#Coding源
git remote set-url origin https://git.coding.net/homebrew/homebrew.git
#三者选其一即可更新

如果以上指令报错,提示
fatal: Not a git repository (or any of the parent directories): .git
可以通过如下指令解决

git init
git remote add origin http://mirrors.ustc.edu.cn/homebrew.git

設置Homebrew Bottles源,編輯~/.bashrc~/.zshrc添加

export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles

來自:Homebrew Bottle Mirror

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容