mac brew 改成阿里镜像

脚本备查:

cd "$(brew --repo)"

git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git

cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"

git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git

echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile


前两步实际上就是去/usr/local/Homebrew目录下把brew和brew-core的git路径给换了,最后一步是二进制源需要修改bashprofile文件改变量。

完后再执行一次brew update 
 

原文地址:https://www.cnblogs.com/qingjiawen/p/13167444.html