國(guó)內(nèi)用官方方式安裝Homebrew的時(shí)候總是會(huì)遇到各種問(wèn)題。但其實(shí)手動(dòng)安裝非常簡(jiǎn)單快速(需要系統(tǒng)中有g(shù)it)桌粉,依次在終端中執(zhí)行以下命令(x86):
cd /usr/local/
git clone https://github.com/Homebrew/brew.git --depth 1
sudo ln -s /usr/local/brew/bin/brew /usr/local/bin/brew
sudo mkdir -p /usr/local/brew/Library/Taps/homebrew
cd /usr/local/brew/Library/Taps/homebrew
git clone https://github.com/Homebrew/homebrew-core.git --depth 1
git clone https://github.com/Homebrew/homebrew-cask.git --depth 1
sudo chown -R $(whoami) /usr/local/brew
sudo chown -R $(whoami) /usr/local/Cellar
sudo chown -R $(whoami) /usr/local/var/homebrew
上述命令中如果提示某文件已存在,先用rm -rf
刪除即可
對(duì)于arm處理器,只需把上面的/usr/local/
換成/opt/
就行
這時(shí)就安裝好了瓷患,可以查看版本試試:
brew -v