我想给mac装软件,发现默认的源是 https://homebrew.bintray.com,这个呢有时候比较慢。怎么解决这个问题呢,就是更改 Homebrew 的安装源,换成国内的源,国内源的有很多,最常见的就是中科大的。
1.替换brew.git
cd "$(brew --repo)"
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
如下图:
2.替换 homebrew-core.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
如下图:
3.Homebrew Bottles 配置镜像
注意:我使用的zsh终端!如果使用bash终端,把下面的zshrc替换为bash_profile即可
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.zshrc
source ~/.zshrc
如下图:
再次下载redis,会发现源已经变了,下载速度也快了。