替换brew.git:
1 2 3 4 |
cd "$(brew --repo)" git remote set-url origin https://mirrors.ustc.edu.cn/brew.git #中科大源 git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git #清华源 brew update |
替换homebrew-core.git:
1 2 3 4 |
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core" git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git #中科大源 git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git #清华源 brew update |
使用homebrew-science或者homebrew-python
1 2 3 4 5 6 7 |
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-science" git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-science.git cd "$(brew --repo)/Library/Taps/homebrew/homebrew-python" git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-python.git brew update |
切换回官方源,重置brew.git:
1 2 |
cd "$(brew --repo)" git remote set-url origin https://github.com/Homebrew/brew.git |
重置homebrew-core.git:
1 2 |
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core" git remote set-url origin https://github.com/Homebrew/homebrew-core.git |
注释掉bash配置文件里的有关Homebrew Bottles即可恢复官方源。 重启bash或让bash重读配置文件。