Homebrew更換國內源提速

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都沒有:
在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章