进入Homebrew官网:https://brew.sh/index_zh-cn
复制命令到终端执行

装好后这时候使用的是github源,如果想换源参考这三篇:
https://segmentfault.com/a/1190000040056668
https://blog.csdn.net/zxmlovena/article/details/104295447
https://blog.csdn.net/m0_46197393/article/details/106752367
也可以参考官方文档,在安装前就配置好源:
https://docs.brew.sh/Installation

另外看的时候发现zsh配置文件竟然是有生命周期的,zprofile就比zshrc先读取
注意的点主要是目录,比如这里的目录应该是有问题的,应该是你$(brew --repo)的目录:

最后如果换成功了,brew doctor的时候会提示warning:

网友评论