1. 安装命令

  1. $ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

⚠ 这里如果访问 raw.githubusercontent.com 有问题,建议将文件保存下来(或者下载这里的文件),然后再通过 /bin/bash install_homebrew.sh 安装。

可能会提示以下报错信息,主要是 gitcurl 版本太低了,无法安装上:

  1. HEAD is now at bdc3391 Merge pull request #11793 from Homebrew/revert-11781-remove_homebrew_bottle_domain
  2. Error: Please update your system curl.
  3. Minimum required version: 7.41.0
  4. Your curl version: 7.29.0
  5. Your curl executable: /usr/bin/curl
  6. Error: Please update your system Git.
  7. Minimum required version: 2.7.0

2. 升级 curl 和 git

如果你的服务器是 CentOS 系统,可以参考以下文档来进行升级。
📶升级curl
🏧升级Git

3. 安装

  1. $ /bin/bash install_homebrew.sh
  2. $ echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /home/yumingmin/.zprofile
  3. $ eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"