HomeBrew默认的源在国内运行实在太慢,忍耐度有限,于是搜了一下怎么切换到国内源,之前对清华大学和中科大的体验比较好。
我是Bash用户,于是按以下方法切换。
1. vim ~/.bash_profile
2. 找个合适的地方粘贴HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles
3. 执行source ~/.bash_profile
更方便的操作如下:
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile
zsh用户参考以下方法:
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.zshrc
source ~/.zshrc