homebrew安裝太慢!
主要原因還是git下載太慢,然後發現git要快還要用到brew去安裝privoxy,心態崩了有沒有?!
目前速度較快的brew鏡像源是ustc的。那麼開始操作吧。
安裝
下載安裝腳本
拷貝粘貼完成後,賦予它執行權限
chmod a+x install.sh
修改git源
vim install.sh
BREW_REPO="https://github.com/Homebrew/brew"
修改爲
BREW_REPO="https://mirrors.ustc.edu.cn/brew.git"
執行安裝腳本
./install
直接克隆homebrew-core
是的,安裝腳本中沒地方改homebrew-core的源。所以下載homebrew-core依然很慢,這個時候可以中斷安裝程序,直接克隆ustc源的homebrew-core。
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git clone https://mirrors.ustc.edu.cn/homebrew-core.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
之後就可以快樂地玩耍了。