imzhi

起因是用 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 镜像源。

分类:

技术点:

相关文章:

  • 2021-12-14
  • 2021-08-06
  • 2021-12-02
  • 2021-12-15
  • 2021-12-15
猜你喜欢
  • 2021-10-28
  • 2021-11-12
  • 2021-10-18
  • 2021-11-04
  • 2021-06-01
  • 2021-12-20
  • 2021-08-14
相关资源
相似解决方案