天天看點

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. 恢複預設源阿裡雲的源不推薦,各種缺貨。

繼續閱讀