- 访问https://raw.githubusercontent.com/Homebrew/install/master/install,
command+s 保存为 brew_install
https://raw.githubusercontent.com/Homebrew/install/master/install
- 编辑brew_install,注释掉原有BREW_REPO和CORE_TAP_REPO(可能没有),替换为
BREW_REPO = "git://mirrors.ustc.edu.cn/brew.git".freeze
CORE_TAP_REPO = "git://mirrors.ustc.edu.cn/homebrew-core.git".freeze
- 安装
/usr/bin/ruby 文件目录/brew_install
- 后续
cd "$(brew --repo)"
git remote set-url origin git://mirrors.ustc.edu.cn/brew.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin git://mirrors.ustc.edu.cn/homebrew-core.git
brew update
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile
brew doctor