推荐使用清华大学的镜像,原因见文末

清华大学

1
2
3
4
5
6
7
8
9
## 替换brew.git:
git -C "$(brew --repo)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
## 替换homebrew-core.git:
git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
## 应用生效
brew update
## 替换homebrew-bottles:
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile

清华大学开源软件镜像站

https://mirrors.tuna.tsinghua.edu.cn/help/homebrew/
https://mirrors.tuna.tsinghua.edu.cn/help/homebrew-bottles/

阿里云

1
2
3
4
5
6
7
8
9
10
11
## 替换brew.git:
cd "$(brew --repo)"
git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git
## 替换homebrew-core.git:
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git
## 应用生效
brew update
## 替换homebrew-bottles:
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile

阿里巴巴开源镜像站

https://opsx.alibaba.com/mirror?lang=zh-CN

2019 年 7 月 13 日更新
很多小伙伴反应阿里云的源 brew update 没反应,不知道是不是教育网的问题,阿里云镜像站的官网在 这里,小伙伴们可以去自行确认一下