sudo apt-get install -y linuxbrew-wrapper
sudo apt-get install -y build-essential
- 平时我们执行 brew 命令安装软件的时候,跟以下 3 个仓库地址有关:
brew.git homebrew-core.git homebrew-bottles
# 替换 brew.git 仓库地址 为阿里巴巴的 brew.git 仓库地址:
cd "$(brew --repo)"
git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git
# 还原 brew.git 仓库地址 为官方提供的 brew.git 仓库地址
# cd "$(brew --repo)"
# git remote set-url origin https://github.com/Homebrew/brew.git
# 替换 homebrew-core.git 仓库地址 为阿里巴巴的 homebrew-core.git 仓库地址:
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git
# 还原 homebrew-core.git 仓库地址 为官方提供的 homebrew-core.git 仓库地址
# cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
# git remote set-url origin https://github.com/Homebrew/homebrew-core.git
# 替换成阿里的 homebrew-bottles 访问地址
sudo echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> /etc/profile
source /etc/profile
# 还原为官方提供的 homebrew-bottles
# 删除 HOMEBREW_BOTTLE_DOMAIN 这一行配置
source /etc/profile
brew install watchman
# 会下载很多依赖的源码包, 编译安装, 整个编译过程耗费一个多小时, 居然没有现成的二进制安装包, 浪费生命和时间, brew这种仓库有毛意义