brew使用国内镜像加速
1. 替换 Homebrew 核心仓库
切换 Homebrew core 仓库到中科大镜像
cd "$(brew --repo)"
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
切换 Homebrew Core 仓库
cd "$(brew --repo homebrew/core)"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
更新
brew update
2. 替换 Bottles 镜像(下载二进制包)
设置环境变量
export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles
永久生效:
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.zshrc