替换与还原官方镜像
打开终端,分别输入
cd "$(brew --repo)"
git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.aliyun.com/homebrew-core.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-cask"
git remote set-url origin https://mirrors.aliyun.com/homebrew-cask.git
bash终端操作输入:
echo 'export HOMEBREW_BOTTLE_DOMAIN=https:mirrors.aliyun.com/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile
zsh终端操作输入:
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.zshrc
source ~/.zshrc
还原成官方镜像
cd "$(brew --repo)"
git remote set-url origin https://github.com/Homebrew/brew.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://github.com/Homebrew/homebrew-core.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-cask"
git remote set-url origin https://github.com/Homebrew/homebrew-cask.git
bash终端操作输入:
还原为官方提供的 homebrew-bottles 访问地址
vi ~/.bash_profile
1. 在INSERT模式按“i”键,进入写入模式
2. 然后,删除 HOMEBREW_BOTTLE_DOMAIN 这一行配置
3. 最后按“esc”键,在最下面的“:”后输入指令“wq!”退出
source ~/.bash_profile
zsh终端操作输入:
还原为官方提供的 homebrew-bottles 访问地址
vi ~/.zshrc
1. 在INSERT模式按“i”键,进入写入模式
2. 然后,删除 HOMEBREW_BOTTLE_DOMAIN 这一行配置
3. 最后按“esc”键,在最下面的“:”后输入指令“wq!”退出
source ~/.zshrc