1.中科大(可用)
# 参考
http://mirrors.ustc.edu.cn/help/brew.git.html
1. 使用 jsDelivr CDN 下载 install.sh,然后将脚本中的 HOMEBREW_BREW_GIT_REMOTE 变量对应的值修改为 https://mirrors.ustc.edu.cn/brew.git。
2. git config --global url."https://mirrors.ustc.edu.cn/homebrew-core.git".insteadOf "https://github.com/Homebrew/homebrew-core"
3. git config --global url."https://mirrors.ustc.edu.cn/linuxbrew-core.git".insteadOf "https://github.com/Homebrew/linuxbrew-core"
4. git config --global url."https://mirrors.ustc.edu.cn/brew.git".insteadOf "https://github.com/Homebrew/brew"
5. chmod +x install.sh
# 安装
6. HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles ./install.sh
7. brew update
-
清华(Error: 'git' must be installed and in your PATH!)
https://mirrors.tuna.tsinghua.edu.cn/help/homebrew/ -
按照这个试试
#1. 下载
curl https://itqiankun.oss-cn-beijing.aliyuncs.com/others/brew_install.rb -o brew_install.rb # 20210314 无法下载
#或者
#https://raw.githubusercontent.com/Homebrew/install/master/install
#2. 安装
ruby brew_install.rb
#3. 设置权限
sudo chown -R "$USER":admin /usr/local
sudo chown -R "$USER":admin /Library/Caches/Homebrew
#上面不行用下面的命令
sudo chown -R $(whoami) $(brew --prefix)/*
#4. 设置brew源
#参考:https://mirrors.tuna.tsinghua.edu.cn/help/homebrew/