Homebrew更换国内源提速

1. 推荐中科大源

1.1 临时更换中科大源

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

#替换homebrew-core.git:
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core" && git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
 
#步骤三
brew update

1.2 永久更换中科大源:

用户profile添加

export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles

1.3 然后source用户profile生效。



2. 清华源是第二选择

2.1 临时更换清华源

#替换brew.git:
cd "$(brew --repo)" && git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
 
#替换homebrew-core.git:
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core" && git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
 
#步骤三
brew update

2.2 永久更换清华源:

用户profile添加

export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles

2.3 然后source用户profile生效。



3. 恢复默认源

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 && brew update


阿里云的源不推荐,各种缺货。

比如连cmake都没有:
在这里插入图片描述

发布了227 篇原创文章 · 获赞 148 · 访问量 34万+

猜你喜欢

转载自blog.csdn.net/toopoo/article/details/104709816
今日推荐