赞
踩
ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
1.替换brew.git:
- cd $(brew --repo)
- git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git
2.替换homebrew-core.git:
- cd $(brew --repo)/Library/Taps/homebrew/homebrew-core
- git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git
3.终端输入命令:
echo $SHELL 看输出结果是/bin/zsh还是/bin/bash
- echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.zshrc
- source ~/.zshrc
- echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
- source ~/.bash_profile
4.恢复homebrew国内镜像源配置
- cd $(brew --repo)
- git remote set-url origin https://github.com/Homebrew/brew.git
- cd $(brew --repo)/Library/Taps/homebrew/homebrew-core
- git remote set-url origin https://github.com/Homebrew/homebrew-core.git
将刚添加到~/.bash_profile文件的语句注释掉即可
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。