打开终端
cd "$(brew --repo)"
git remote set-url origin mirrors.ustc.edu.cn/brew.git
#更新Homebrew-core
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin mirrors.ustc.edu.cn/homebrew-co…
#更新Homebrew-cask(最重要的一步,很多更新完国内源依然卡就是没更新这个)
cd "$(brew --repo)"/Library/Taps/homebrew/homebrew-cask
git remote set-url origin mirrors.ustc.edu.cn/homebrew-ca…
vim ~/.zshrc
添加下面一行:
export HOMEBREW_BOTTLE_DOMAIN=mirrors.ustc.edu.cn/homebrew-bo…
source .zshrc
更新: