1. 程式人生 > >macbook安裝homebrew並更換清華源

macbook安裝homebrew並更換清華源

git date book core origin tap spa 完成後 url

1、官網brew.sh復制安裝腳本。

2、自動安裝完成後,更換為清華源來加快速度。網址為:https://mirrors.tuna.tsinghua.edu.cn/help/homebrew

3、更換homebrew

cd "$(brew --repo)"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.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

更換homebrew-bottles

長期更換
echo export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles >> ~/.bash_profile
source ~/.bash_profile
臨時更換
export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles

macbook安裝homebrew並更換清華源