安装homebrew很慢卡住了

https://blog.csdn.net/DiyHzp/article/details/90763558

网速快可使用此方法官网安装Homebrew
/usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”

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

打开 brew_install 文件,修改如下:
找到如下代码:
BREW_REPO = “https://github.com/Homebrew/brew“.freeze
CORE_TAP_REPO = “https://github.com/Homebrew/homebrew-core“.freeze
复制代码更改为:
BREW_REPO = “https://mirrors.ustc.edu.cn/brew.git “.freeze
CORE_TAP_REPO = “https://mirrors.ustc.edu.cn/homebrew-core.git“.freeze
注意:
新版本HomeBrew可能没有CORE_TAP_REPO这句代码,如果没有不用新增。

执行脚本
/usr/bin/ruby brew_install
此时脚本应该停在
==> Tapping homebrew/core
Cloning into ‘/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core’…
解决方法,手动执行下面这句命令,更换为中科院的镜像:
git clone git://mirrors.ustc.edu.cn/homebrew-core.git/ /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core --depth=1

然后就替换homebrew源

 https://www.cnblogs.com/DjangoBlogs/p/10762310.html

posted @ 2019-12-25 11:22  Max-Jiang  阅读(4153)  评论(0编辑  收藏  举报