国内在使用homebrew更新的时候因为网络原因最会非常慢,所以查了换清华源的方案。
Homebrew 镜像使用帮助
注:该镜像是 Homebrew 的 formula 索引的镜像(即 brew update 时所更新内容)。
替换现有上游
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
复原
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
Homebrew-bottles 镜像使用帮助
注:该镜像是 Homebrew 二进制预编译包的镜像。
临时替换
export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles
长期替换
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile
本文提供了一套详细的指南,教你如何将Homebrew的源更换为清华镜像,以提升在中国地区的更新速度。包括替换现有上游、复原操作及Homebrew-bottles镜像的临时与长期替换步骤。
1366

被折叠的 条评论
为什么被折叠?



