平常执行brew命令安装软件的时候,跟以下三个仓库地址有关:
- brew.git
- homebrew-core.git
- homebrew-bottles
1、brew.git仓库地址
替换
cd "$(brew --repo)"
git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git
还原
cd "$(brew --repo)"
git remote set-url origin https://github.com/Homebrew/brew.git
2、homebrew-core.git 仓库地址
替换
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git
还原
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://github.com/Homebrew/homebrew-core.git
3、homebrew-bottles 访问地址
查看当前shell
echo $SHELL
/bin/zsh
zsh替换
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.zshrc
source ~/.zshrc
zsh还原
vi ~/.zshrc
然后,删除 HOMEBREW_BOTTLE_DOMAIN 这一行配置
source ~/.zshrc
bash替换
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.bashrc
source ~/.bashrc
还原
vi ~/.bashrc
然后,删除 HOMEBREW_BOTTLE_DOMAIN 这一行配置
source ~/.bashrc