镜像网址(找到适合自己的版本)
https://brew.idayer.com/guide/change-source/
1.执行安装脚本
export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"
/bin/bash -c "$(curl -fsSL https://cdn.jsdelivr.net/gh/ineo6/homebrew-install/install.sh)"
2.安装完成后设置
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/' >> ~/.bash_profile
source ~/.bash_profile
解决brew运行错误
"==> Searching for similarly named formulae...
"Error: No similarly named formulae found.
"Error: No available formula or cask with the name "sox".
"==> Searching for a previously deleted formula (in the last month)...
"Error: No previously deleted formula found.
"==> Searching taps on GitHub...
"Error: No formulae found in taps."
git -C $(brew --repo homebrew/core) checkout master