Mac brew源更新

brew更换为国内源

在用brew安装新的软件的时候一直出现:

1
Updating Homebrew...

主要是因为它试图在连接国外的源,

改成国内的源就好了:

1
2
3
4
5
6
#替换brew.git:
cd "$(brew --repo)"
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
#替换homebrew-core.git:
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git