安装参考: https://brew.sh/index_zh-cn.html
1、 打开终端 输入
/usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
过程会有点慢,而且总是报各种错误 (解决办法)
2、换方法 https://blog.csdn.net/u013983033/article/details/83118843
点击查看
1、将brew的install文件下载本地
终端输入 cd
终端输入 curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install >> brew_install
2、修改install文件的镜像源
终端输入 vim brew_install
将下面两行进行修改
#BREW_REPO = "https://github.com/Homebrew/brew”.freeze
#CORE_TAP_REPO = “https://github.com/Homebrew/homebrew-core”.freeze
替换成下面两句
BREW_REPO = “https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git”.freeze
CORE_TAP_REPO = "https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git”.freeze
#就是“BREW_REPO”和“CORE_TAP_REPO”这两项,将其修改为清华的镜像
3、安装
ruby ~/brew_install