1. 安装命令
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
⚠ 这里如果访问 raw.githubusercontent.com 有问题,建议将文件保存下来(或者下载这里的文件),然后再通过
/bin/bash install_homebrew.sh
安装。
可能会提示以下报错信息,主要是 git
和 curl
版本太低了,无法安装上:
HEAD is now at bdc3391 Merge pull request #11793 from Homebrew/revert-11781-remove_homebrew_bottle_domain
Error: Please update your system curl.
Minimum required version: 7.41.0
Your curl version: 7.29.0
Your curl executable: /usr/bin/curl
Error: Please update your system Git.
Minimum required version: 2.7.0
2. 升级 curl 和 git
如果你的服务器是 CentOS 系统,可以参考以下文档来进行升级。
📶升级curl
🏧升级Git
3. 安装
$ /bin/bash install_homebrew.sh
$ echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /home/yumingmin/.zprofile
$ eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"