brew
默認的源是Github
,會很是慢,建議換爲國內的源。推薦中科大的鏡像源
,比較全面.git
Homebrew
源代碼倉庫github
替換源地址:
cd "$(brew --repo)" git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
bash
重置爲官方地址:
cd "$(brew --repo)" git remote set-url origin https://github.com/Homebrew/brew.git
url
Homebrew
預編譯二進制軟件包code
在運行brew
, 前設置環境變量HOMEBREW_BOTTLE_DOMAIN
,值爲https://mirrors.ustc.edu.cn/homebrew-bottles
homebrew
bash:
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile source ~/.bash_profile
rem
zsh:
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.zshrc source ~/.zshrc
it
Homebrew
核心軟件倉庫zsh
替換源地址:
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core" git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
編譯
重置爲官方地址:
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core" git remote set-url origin https://github.com/Homebrew/homebrew-core
Homebrew cask
軟件倉庫,提供macOS
應用和大型二進制文件
替換源地址:
cd "$(brew --repo)"/Library/Taps/homebrew/homebrew-cask git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git
重置爲官方地址:
cd "$(brew --repo)"/Library/Taps/homebrew/homebrew-cask git remote set-url origin https://github.com/Homebrew/homebrew-cask