镜像网站配置
配置环境时常常要修改国内镜像,记录常用的镜像网站。
常见镜像站
- SJTU:https://mirror.sjtu.edu.cn
- 清华:https://mirrors.tuna.tsinghua.edu.cn
- 阿里:https://developer.aliyun.com/mirror/
- 腾讯:https://mirrors.cloud.tencent.com
- 中科大:https://mirrors.ustc.edu.cn
常用的配置
Homebrew
- 阿里云:https://mirrors.cloud.tencent.com/help/homebrew.html
- 腾讯云:https://mirrors.cloud.tencent.com/help/homebrew.html
- 中科大:http://mirrors.ustc.edu.cn/help/brew.git.html
以中科大为例
# 替换brew.git
cd "$(brew --repo)"
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
# 替换homebrew-core.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
# 应用生效
brew update
# 替换homebrew-bottles
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.zshrc
source ~/.zshrc