homebrew跟换源解决下载慢问题
用原有的镜像下载非常慢 => 🚶
替换源,更新速度变成 => 🚀
第一步:更换仓库源
homebrew 默认的源是在 github 上面,每次更新速度都会非常慢。所以我们更换成国内的镜像源。就会快很多了。
1 cd "$(brew --repo)" 2 git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git 3 4 cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core" 5 git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git 6 7 cd "$(brew --repo)"/Library/Taps/homebrew/homebrew-cask 8 git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git 9 10 brew update
第二步:更换 Homebrew-bottles 镜像(影响软件下载速度)
临时替换
1 export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles
永久替换
1 echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.bash_profile 2 source ~/.bash_profile
原文:https://www.jianshu.com/p/ff2ad9599a06