当前位置:   article > 正文

Mac下载安装brew特别慢的问题解决_/bin/bash -c "$(curl -fssl brew

/bin/bash -c "$(curl -fssl brew

1.用safari打开“https://raw.githubusercontent.com/Homebrew/install/master/install.sh”,把里面的文本复制下来,在桌面创建文本文件“brew_install”,粘贴.

2.搜索:

BREW_REPO="https://github.com/Homebrew/brew"

替换成:

BREW_REPO="https://mirrors.ustc.edu.cn/brew.git"

保存.

3.打开terminal,运行命令:/bin/bash + 刚才的brew_install文件,比如:

/bin/bash /Users/admin/Desktop/brew_install

2.png

4.进入下面的 Taps 目录,clone homebrew-core

  1. cd /usr/local/Homebrew/Library/Taps/homebrew (如果没有homebrew,新建homebrew文件夹)
  2. git clone https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git

5.把homebrew repo切换为清华镜像

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

PS:如果有报错:curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused,可以通过这个命令解决:sudo gem install redis


 

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

闽ICP备14008679号