当前位置:   article > 正文

brew 换镜像网站_brew 镜像

brew 镜像

在国内,使用brew极慢. 因为它需要访问国外的一些服务器.

解决方法是使用国内的镜像站.

如果是首次安装:

curl https://raw.githubusercontent.com/Homebrew/install/master/install.sh  > install-brew.sh

然后,在下载的文件中, 修改BREW_REPO为:

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

最后, 运行:

HOMEBREW_CORE_GIT_REMOTE=https://mirrors.ustc.edu.cn/homebrew-core.git bash install-brew.sh

如果是已经安装了brew, 可以这样替换镜像站:

  1. cd "$(brew --repo)"
  2. git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
  3. echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
  4. source ~/.bash_profile
  5. cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
  6. git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git

替换后, 就可以正常使用brew了.

参考这篇文章 ==》 Mac解决brew慢的问题,添加国内源 

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

闽ICP备14008679号