首页 > 其他 > 详细

HomeBrew 使用国内数据源

时间:2018-09-15 14:14:12      阅读:496      评论:0      收藏:0      [点我收藏+]

使用中科大源

1、替换默认源

替换USTC镜像:

cd "$(brew --repo)"
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git

重置为官方地址:

cd "$(brew --repo)"
git remote set-url origin https://github.com/Homebrew/brew.git

2、替换homebrew-core.git

替换 USTC 镜像:

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

重置为官方地址:

cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://github.com/Homebrew/homebrew-core

brew update

3、替换Homebrew Bottles源

请在运行 brew 前设置环境变量 HOMEBREW_BOTTLE_DOMAIN ,值为 https://mirrors.ustc.edu.cn/homebrew-bottles

对于 bash 用户:

echo ‘export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles‘ >> ~/.bash_profile
source ~/.bash_profile

对于 zsh 用户:

echo ‘export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles‘ >> ~/.zshrc
source ~/.zshrc

4、替换 Homebrew Cask 源

替换为 USTC 镜像:

cd "$(brew --repo)"/Library/Taps/homebrew/homebrew-cask
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git

重置为官方地址:

cd "$(brew --repo)"/Library/Taps/homebrew/homebrew-cask
git remote set-url origin https://github.com/Homebrew/homebrew-cask

HomeBrew 使用国内数据源

原文:https://www.cnblogs.com/dowhile/p/HomeBrew-shi-yong-guo-nei-shu-ju-yuan.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!