Leif160519的blog Leif160519的blog

——————

目录
Homebrew 换源
/    

Homebrew 换源

中科大的镜像

中科大镜像比较稳定,而且速度不错。

官方网站: http://mirrors.ustc.edu.cn/

搜索 brew ,然后点击 Help 即可查看用法:

替换Homebrew默认源

替换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

替换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

清华大学镜像

也是比较靠谱的开源镜像。

官方网站: https://mirror.tuna.tsinghua.edu.cn/help/homebrew/

替换Homebrew默认源

替换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

使用homebrew-science或者homebrew-python

➜ cd "$(brew --repo)/Library/Taps/homebrew/homebrew-science"
➜ git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-science.git
➜ cd "$(brew --repo)/Library/Taps/homebrew/homebrew-python"
➜ git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-python.git
➜ brew update

替换Homebrew Bottles源

对于bash用户:

➜ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.bash_profile
➜ source ~/.bash_profile

对于zsh用户:

➜ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.zshrc
➜ source ~/.zshrc

“The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.” – Tom Cargill

标  题Homebrew 换源
作  者Leif160519
出  处https://github.icu/articles/2019/08/29/1567067870796.html
关于博主:坐标南京,运维工程师,如有问题探讨可以直接下方留言。
声援博主:如果您觉得文章对您有帮助,可以评论、订阅、收藏。您的鼓励是博主的最大动力!