homebrew 国内镜像的选择(阿里云、腾讯云、中科大)

起因是用 homebrew 官方源安装 imagemagick 提示 mismatch sha256sum,然后就进入漫长的下载源码包编译的过程,大概半个小时过去了仍然没有装好。

第二天,便想起阿里云、腾讯云都有 homebrew 的国内镜像源,再加上中科大的镜像源,都尝试了遍。

阿里云 homebrew

配置方法:[https://developer.aliyun.com/mirror/homebrew]。

# 替换brew.git:
cd "$(brew --repo)"
git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git
# 替换homebrew-core.git:
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git
# 应用生效
brew update
# 替换homebrew-bottles:
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile

腾讯云 homebrew

配置方法:Homebrew 镜像使用帮助 [https://mirrors.cloud.tencent.com/help/homebrew.html]。

cd "$(brew --repo)"
git remote set-url origin http://mirrors.cloud.tencent.com/git/homebrew/brew.git

cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin http://mirrors.cloud.tencent.com/git/homebrew/homebrew-core.git

brew update

配置方法:Homebrew-bottles 镜像使用帮助 [https://mirrors.cloud.tencent.com/help/homebrew-bottles.html]。

echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.cloud.tencent.com/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile

中科大 homebrew

配置方法:Homebrew 源使用帮助[http://mirrors.ustc.edu.cn/help/brew.git.html]。

cd "$(brew --repo)"
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git

配置方法:Homebrew Core 源使用帮助[http://mirrors.ustc.edu.cn/help/homebrew-core.git.html]。

cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git

配置方法:Homebrew Bottles 源使用帮助[http://mirrors.ustc.edu.cn/help/homebrew-bottles.html]。

echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile

使用比较

使用阿里云或者腾讯云的 homebrew 镜像源安装 imagemagick,有的包下载提示404了。中科大源没有报错,就是下载速度比较慢,大概100多k每秒的速度。

最终选择中科大[USTC] homebrew 镜像源。

posted @ 2020-08-12 23:02  imzhi  阅读(11553)  评论(0编辑  收藏  举报