当前位置:   article > 正文

Mac 安装 homebrew 慢解决方案_mac 安装 homebrew 进度特别慢

mac 安装 homebrew 进度特别慢

最近在安装 homebrew 不管用不用梯子都很慢。然后就找了网上的方法,但是有些出入,记载一下最新的方法。

第一步

打开终端执行如下指令

curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh >> brew_install.sh
  • 1

第二步

找到

BREW_REPO = “https://github.com/Homebrew/brew“
  • 1

替换如下:

BREW_REPO = "https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"
  • 1

因为最新版 sh 文件里没有下边的指令

CORE_TAP_REPO = “https://github.com/Homebrew/homebrew-core“
  • 1

所以不需要替换,如果有,替换成下边的:

CORE_TAP_REPO = "https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"
  • 1

第三步

把脚本拖入终端
如果出现下面的问题:

permission denied: ...
  • 1

执行如下指令

chmod 777 brew_install.sh
  • 1

第四步

不出意外你会卡在下边:

==> Tapping homebrew/core
Cloning into ‘/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core’…
  • 1
  • 2

关掉终端,进入如下文件夹
/usr/local/Homebrew/Library/
删除 Taps 文件夹

然后执行如下操作:

git clone git://mirrors.ustc.edu.cn/homebrew-core.git/ /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core --depth=1
  • 1

第五步

把homebrew-core的镜像地址也设为中科院的国内镜像

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

好了到此结束。

参考如下文章
超链 1
超链 2

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/凡人多烦事01/article/detail/147957
推荐阅读
  

闽ICP备14008679号