1、官方安装指令
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
2、国内安装Homebrew:
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
(1)选择下载镜像
(2)输入开机密码
(3)安装git
若之前没有安装git,会阻止homebrew安装,会弹出git安装提示,点击安装即可。
(4)重新运行homebrewan安装指令
(5)选择今后访问的镜像源
(6)验证是否安装成功
重启终端或者运行 source /Users/liujiaomei/.zprofile
输入brew -v,输出版本信息表示安装成功。
3、删除homebrew
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/HomebrewUninstall.sh)"