1. 程式人生 > >How to make brew faster 使用mirror 加速brew的安裝過程

How to make brew faster 使用mirror 加速brew的安裝過程

How to make brew faster when you behind GFW

In China side which is behind GFW, we must suffer from an extremely slow network to use brew. Sometimes, this will even make brew unavailable any more.

How to resolve it?

Thank for USTC and THU, we have brew mirror inside.

cd /usr/local

git remote set-url origin http://mirrors.ustc.edu.cn/homebrew.git
or
git remote set-url origin git://mirrors.tuna.tsinghua.edu.cn/homebrew.git brew update

If still very slow,
cd ~/tmp
git clone http://mirrors.ustc.edu.cn/homebrew.git
or
git clone git://mirrors.tuna.tsinghua.edu.cn/homebrew.git
Above steps will download the latest homebrew into ~/tmp directory, and then reinstall homebrew as following steps:
remove old brew installation:
rm -rf /usr/local/.git rm -rf /usr/local/Library rm -rf /usr/local/bin/brew Replace with new homebrew files: cp -R homebrew/.git /usr/local/ cp -R homebrew/Library /usr/local/ cp homwbrew/bin/brew /usr/local/bin/ and then: brew update brew install ***