更换 homebrew 国内镜像源

Brew 是OS X 上类似apt-get以及yum的一个软件包管理器,它依托于Github………………

所以,虽然你侥幸下载到了 brew,但你肯定是无法更新 brew 的。原因你懂。不过虽然不能更新 brew,但这只是指brew这个管理器本身罢了,软件还是可以安装的。但由于无法使用 brew update 也就无法更新软件……我们有必要来给 brew 换源。

 

安装、卸载homebrew

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

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
sudo rm -rf /usr/local/

替换homebrew默认源

cd /usr/local
git remote set-url origin git://mirrors.ustc.edu.cn/brew.git

替换homebrew-core默认源

cd /usr/local/Library/Taps/homebrew/homebrew-core
git remote set-url origin git://mirrors.ustc.edu.cn/homebrew-core.git

替换homebrew-cask默认源

cd /usr/local/Homebrew/Library/Taps/caskroom/homebrew-cask
git remote set-url origin git://mirrors.ustc.edu.cn/homebrew-cask.git

替换homebrew bottles默认源

echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bashrc
sourch ~/.bashrc

 

PS:

https://servers.ustclug.org/2016/01/mirrors-add-homebrew-bottles-source/

https://www.logcg.com/archives/1301.html

https://mirrors.tuna.tsinghua.edu.cn/help/homebrew/

https://mirrors.tuna.tsinghua.edu.cn/help/homebrew-bottles/

https://lug.ustc.edu.cn/wiki/mirrors/help/homebrew-bottles

 

posted @ 2016-07-03 14:10  phpdragon  阅读(9978)  评论(1编辑  收藏  举报