Homebrew切换镜像源

切换中科大镜像源:
  1. 替换brew.git
    1
    2
    3
    cd /usr/local/Homebrew

    git remote set-url origin https://mirrors.ustc.edu.cn/brew.git

切换回官方源:

https://github.com/Homebrew/brew

  1. 替换homebrew-core.git
    1
    2
    3
    4
    5
    cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core

    git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git

    brew update

切换官方源:

https://github.com/Homebrew/homebrew-core

  1. 替换Homebrew Bottles源
    1
    2
    3
    echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile

    source ~/.bash_profile

切换回官方:

删除~/.bash_profile中的HOMEBREW_BOTTLE_DOMAIN源即可