推荐直接使用一键切换脚本:一键切换brew国内镜像源
1.1. 替换
1 2 3 4 5 6 7
| ➜ git -C "$(brew --repo)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git ➜ git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git ➜ git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git
➜ brew update
|
1.2. 还原
1 2 3 4 5
| ➜ git -C "$(brew --repo)" remote set-url origin https://github.com/Homebrew/brew.git ➜ git -C "$(brew --repo homebrew/core)" remote set-url origin https://github.com/Homebrew/homebrew-core.git ➜ git -C "$(brew --repo homebrew/cask)" remote set-url origin https://github.com/Homebrew/homebrew-cask.git
➜ brew update
|
2. 二进制预编译包 bottles
1 2 3 4
|
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.zshrc source ~/.zshrc
|