参考:https://brew.idayer.com/

如果你是在M1芯片的Mac上安装Homebrew,请参考 M1 芯片安装教程

安装说明

如果之前尝试过其他脚本安装,请移除Homebrew后再安装,具体请参考 FAQ

/bin/bash -c "$(curl -fsSL <https://gitee.com/ineo6/homebrew-install/raw/master/install.sh>)"

如果命令执行中卡在下面信息:

==> Tapping homebrew/core
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'...

Control + C中断脚本执行如下命令:

cd "$(brew --repo)/Library/Taps/"
mkdir homebrew && cd homebrew
git clone git://mirrors.ustc.edu.cn/homebrew-core.git

安装cask 同样也有安装失败或者卡住的问题,解决方法也是一样:

cd "$(brew --repo)/Library/Taps/"
cd homebrew
git clone <https://mirrors.ustc.edu.cn/homebrew-cask.git>

成功执行之后继续执行安装命令。

最后看到==> Installation successful!就说明安装成功了。

最最后更新下:

brew update

设置镜像

<aside> ⚠️ 更新:强烈建议使用 镜像助手 ,你可以自助获取镜像脚本,目前支持中科大、清华、腾讯、北京外国语镜像源。

</aside>

中科大源