输入brew doctor
==> Tapping homebrew/core
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'
此时退出ctl+c
在终端输入命令
cd /usr/local/Homebrew/Library/Taps/homebrew
git clone https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
如果没有/usr/local/Homebrew/Library/Taps/homebrew 这个目录就手动创建一个
替换homebrew默认源,分别再终端输入命令
cd "$(brew --repo)"
git remote set-url origin git://mirrors.ustc.edu.cn/brew.git
替换homebrew-core源
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin git://mirrors.ustc.edu.cn/homebrew-core.git
更新brew
brew update
设置 bintray镜像
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile