1. 脚本说明
Homebrew默认安装脚本:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
如果你等待一段时间之后遇到下面提示,就说明无法访问官方脚本地址:
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Operation timed out
请使用下面的脚本:
/usr/bin/ruby -e "$(curl -fsSL https://cdn.jsdelivr.net/gh/ineo6/homebrew-install/install)"
2. 执行命令
/usr/bin/ruby -e "$(curl -fsSL https://cdn.jsdelivr.net/gh/ineo6/homebrew-install/install)"
如果命令执行中卡在下面信息:
==> Tapping homebrew/core
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'...
请中断脚本执行,复制以下如下命令:
cd "$(brew --repo)/Library/Taps/"
mkdir homebrew && cd homebrew
git clone git://mirrors.ustc.edu.cn/homebrew-core.git
成功执行之后继续执行前文的安装命令。
最后看到==> Installation successful!就说明安装成功了。
最最后执行:
brew update
cask同样也有首次下载缓慢的问题,解决方法大致同上:
cd "$(brew --repo)/Library/Taps/"
cd homebrew
git clone https://mirrors.ustc.edu.cn/homebrew-cask.git
3. 卸载Homebrew
使用官方脚本同样会遇到uninstall地址无法访问问题,可以替换为下面脚本:
/usr/bin/ruby -e "$(curl -fsSL https://cdn.jsdelivr.net/gh/ineo6/homebrew-install/uninstall)"