1. 获取官网脚本
curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install>> brew_install
2. 更改镜像,替换成国内的镜像
如下:
BREW_REPO = "https://github.com/Homebrew/brew"
CORE_TAP_REPO = "https://github.com/Homebrew/homebrew-core"
更改为这两句
BREW_REPO = "https://mirrors.ustc.edu.cn/brew.git"
CORE_TAP_REPO = "https://mirrors.ustc.edu.cn/homebrew-core.git"
3. 执行脚本
使用ruby安装homebrews
/usr/bin/ruby brew_install