1. 腳本說(shuō)明
Homebrew默認(rèn)安裝腳本:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
如果你等待一段時(shí)間之后遇到下面提示外莲,就說(shuō)明無(wú)法訪問(wèn)官方腳本地址:
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Operation timed out
請(qǐng)使用下面的腳本:
/usr/bin/ruby -e "$(curl -fsSL https://cdn.jsdelivr.net/gh/ineo6/homebrew-install/install)"
2. 執(zhí)行命令
/usr/bin/ruby -e "$(curl -fsSL https://cdn.jsdelivr.net/gh/ineo6/homebrew-install/install)"
如果命令執(zhí)行中卡在下面信息:
==> Tapping homebrew/core
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'...
請(qǐng)中斷腳本執(zhí)行脸候,復(fù)制以下如下命令:
cd "$(brew --repo)/Library/Taps/"
mkdir homebrew && cd homebrew
git clone git://mirrors.ustc.edu.cn/homebrew-core.git
成功執(zhí)行之后繼續(xù)執(zhí)行前文的安裝命令嬉挡。
最后看到==> Installation successful!就說(shuō)明安裝成功了榴徐。
最最后執(zhí)行:
brew update
cask同樣也有首次下載緩慢的問(wèn)題,解決方法大致同上:
cd "$(brew --repo)/Library/Taps/"
cd homebrew
git clone https://mirrors.ustc.edu.cn/homebrew-cask.git
3. 卸載Homebrew
使用官方腳本同樣會(huì)遇到uninstall地址無(wú)法訪問(wèn)問(wèn)題疤估,可以替換為下面腳本:
/usr/bin/ruby -e "$(curl -fsSL https://cdn.jsdelivr.net/gh/ineo6/homebrew-install/uninstall)"