天天看点

Homebrew更换国内源提速1. 推荐中科大源2. 清华源是第二选择3. 恢复默认源阿里云的源不推荐,各种缺货。

1. 推荐中科大源

1.1 临时更换中科大源

#替换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
 
#步骤三
brew update
           

1.2 永久更换中科大源:

用户profile添加

export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles
           

1.3 然后source用户profile生效。

2. 清华源是第二选择

2.1 临时更换清华源

#替换brew.git:
cd "$(brew --repo)" && git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
 
#替换homebrew-core.git:
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core" && git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
 
#步骤三
brew update
           

2.2 永久更换清华源:

用户profile添加

export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles
           

2.3 然后source用户profile生效。

3. 恢复默认源

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 && brew update
           

阿里云

的源

不推荐

,各种缺货。

比如连

cmake

都没有:

Homebrew更换国内源提速1. 推荐中科大源2. 清华源是第二选择3. 恢复默认源阿里云的源不推荐,各种缺货。

继续阅读