当前位置:   article > 正文

homebrew安装和解决brew安装速度慢的问题_homebrew安装好慢

homebrew安装好慢

homebrew安装

ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”

解决brew安装速度慢的问题(替换homebrew镜像源)

1.替换brew.git:

  1. cd $(brew --repo)
  2. git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git

2.替换homebrew-core.git:

  1. cd $(brew --repo)/Library/Taps/homebrew/homebrew-core
  2. git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git

3.终端输入命令:

echo $SHELL 看输出结果是/bin/zsh还是/bin/bash

  • /bin/zsh替换homebrew-bottles:
  1. echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.zshrc
  2. source ~/.zshrc
  • /bin/bash替换homebrew-bottles:
  1. echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
  2. source ~/.bash_profile

4.恢复homebrew国内镜像源配置

  • 重置brew.git
  1. cd $(brew --repo)
  2. git remote set-url origin https://github.com/Homebrew/brew.git
  • 重置homebrew-core.git
  1. cd $(brew --repo)/Library/Taps/homebrew/homebrew-core
  2. git remote set-url origin https://github.com/Homebrew/homebrew-core.git
  • 重置homebrew-bottles
将刚添加到~/.bash_profile文件的语句注释掉即可
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小蓝xlanll/article/detail/414580
推荐阅读
相关标签
  

闽ICP备14008679号