安装 Homebrew
官网上的命令,我一输入到终端,终端他就没反应,有时候有反应,最后也是卡死在那里…
猜测是网络的问题哈,所以思路就是换镜像了,以下是清华大学的镜像,按照他的步骤来即可。
报错:No similarly named formulae found.
我安装 aria2 的时候提示这玩意儿,哎好难
参考这个:更新国内源
命令按照博客里的一行一行敲即可。
# 1.先更新 brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# 2.更新 Homebrew
cd "$(brew --repo)"
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
# 更新 Homebrew-core
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
# 更新 Homebrew-cask(最重要的一步,很多更新完国内源依然卡就是没更新这个)
cd "$(brew --repo)"/Library/Taps/homebrew/homebrew-cask
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git
# 3. 更新 HOMEBREW_BOTTLE_DOMAIN(最重要,根据用户类型,选择不同的命令)
## 使用 zsh 的用户
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles/' >> ~/.zshrc
source ~/.zshrc
## 使用 bash 的用户
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles/' >> ~/.bash_profile
source ~/.bash_profile
# 4. 更新库
brew update-reset
最后可以正常安装了