使用homebrew腳本安裝的時(shí)候 會(huì)因?yàn)樵L問(wèn)問(wèn)題失敗粱坤,此時(shí)通過(guò)手動(dòng)安裝 使用鏡像地址可以解決
創(chuàng)建安裝文件夾
sudo mkdir /usr/local/Homebrew
直接從鏡像地址git clone
sudo git clone https://mirrors.ustc.edu.cn/brew.git /usr/local/Homebrew
創(chuàng)建鏈接,如果已經(jīng)存在 則刪除后再創(chuàng)建
sudo ln -s /usr/local/Homebrew/bin/brew /usr/local/bin/brew
創(chuàng)建core文件夾 并且完成core的clone
sudo mkdir -p /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
sudo git clone https://mirrors.ustc.edu.cn/homebrew-core.git /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
調(diào)整權(quán)限尚揣,并運(yùn)行更新
sudo chown -R $(whoami) /usr/local/Homebrew
brew update
更新環(huán)境變量
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.zshrc
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile