1.1 获取install文件 把官方脚本拿下来
curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install >> brew_install
当前命令执行完后,会在/usr/local/Homebrew下生成一个brew_install文件
1.2 更改脚本中的资源链接,替换成清华大学的镜像
vim /usr/local/Homebrew/brew_install
就是把这两句
BREW_REPO=“https://github.com/Homebrew/brew“.freeze CORE_TAP_REPO=“https://github.com/Homebrew/homebrew-core“.freeze
更改为这两句
BREW_REPO=“https://mirrors.ustc.edu.cn/brew.git “.freeze CORE_TAP_REPO=“https://mirrors.ustc.edu.cn/homebrew-core.git“.freeze
1.3 执行脚本
/usr/bin/ruby brew_install
1.4 brew常用命令
brew update #更新可安装包的最新信息,建议每次安装前都运行下
brew search pkg_name #搜索相关的包信息
brew install pkg_name #安装包
网友评论