美文网首页
解决 brew 下载慢的问题

解决 brew 下载慢的问题

作者: zackxizi | 来源:发表于2019-11-09 02:37 被阅读0次
  • 问题:
    使用Homebrew安装软件的时候一直卡在Update阶段。同时发现从github.com下载文件也极度缓慢(几十 KB/s)
  • 解决:
  1. 更换使用国内的homebrew镜像源;使用以下命令更换国内阿里云上的homebrew镜像:
  2. 使用代理访问github.com。
  3. 阿里云的镜像站没有提供homebrew-cask,进一步搜索找到USTC镜像站,该站提供了homebrew-cask的源。使用上述同样的命令更换源:
# 替换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

# 替换homebrew-bottles:
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.zshrc
source ~/.zshrc
# 替换homebrew-cask.git:
cd "$(brew --repo)"/Library/Taps/homebrew/homebrew-cask
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git

完成之后,查看速度,包你满意!!!

image.png

相关文章

网友评论

      本文标题:解决 brew 下载慢的问题

      本文链接:https://www.haomeiwen.com/subject/acsgbctx.html