用原有的镜像下载非常慢,可以见镜像更新为清华源,参考链接:清华homebrew源
第一步:更换仓库源
homebrew 默认的源是在 github 上面,每次更新速度都会非常慢。所以更换成国内的镜像源,就会快很多:
# 第一步
cd "$(brew --repo)"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
# 第二步
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
# 第三步
cd "$(brew --repo)"/Library/Taps/homebrew/homebrew-cask
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git
# 第四步
brew update
第二步:更换bottles镜像
这步会影响软件下载速度
临时替换
# 临时改变环境变量
export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles
永久替换
# 将环境变量写入bash source

本文介绍如何通过更换镜像源加速Homebrew的更新及软件下载过程,包括更换仓库源和bottles镜像的具体步骤。
最低0.47元/天 解锁文章
1万+

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



