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