mac安装brew工具因为网络或者海外网站原因失败的解决方案

一,把官网给的脚本拿下来

curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install >> brew_install

二,更改脚本中的资源链接,替换成清华大学的镜像

就是把句
BREW_REPO = "https://github.com/Homebrew/brew".freeze
更改为这两句
BREW_REPO = "https://mirrors.ustc.edu.cn/brew.git ".freeze
这个镜像有问题的话,也可以换成别的

三,更换国内镜像源:

执行下面这句命令,更换为中科院的镜像:

git clone git://mirrors.ustc.edu.cn/homebrew-core.git/ /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core --depth=1

就下载成功了

 四,执行脚本

/usr/bin/ruby brew_install

五,开始使用brew命令

 

posted on 2019-08-14 18:16  PandOne  阅读(3209)  评论(0编辑  收藏  举报

导航