我用的是中科大的源,在安装brew install ffmpeg
过程中下载依赖的时候频繁提示404,falling back to the default domain...
,然后在依赖开始安装过程中又提示Bottle missing
,找不到安装文件。手动brew install
缺失的依赖可以继续,但是连续若干次之后我就觉得不对了。
于是找了几个方法,我使用的是第一种,其它方法供参考:
1. 更新镜像源
临时:
export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.ustc.edu.cn/brew.git"
brew update
永久
zsh
用户:
echo 'export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.ustc.edu.cn/brew.git"' >> ~/.zshrc
source ~/.zshrc
bash
用户:
echo 'export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.ustc.edu.cn/brew.git"' >> ~/.bashrc
source ~/.bashrc
2. 更新bottle源
将~/.zshrc
或者~/.bashrc
中的
export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles
改为
export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles/bottles
然后source ~/.zshrc
或者source ~/.bashrc
3. 更换为默认的镜像源
unset HOMEBREW_BREW_GIT_REMOTE
git -C "$(brew --repo)" remote set-url origin https://github.com/Homebrew/brew