1. 程式人生 > 其它 >homeBrew 安裝和更換USTC源

homeBrew 安裝和更換USTC源

1. homeBrew安裝

gitee 安裝homeBrew

/bin/zsh -c "$(curl -fsSLzhttps://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

2 更換國內源

# 檢視brew source
cd "$(brew --repo)" && git remote -v
cd "$(brew --repo homebrew/core)" && git remote -v
# 替換各個源
 git -C "$(brew --repo)" remote set-url origin https://mirrors.ustc.edu.cn/brew.git &&
 git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git &&
 git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git

# zsh 替換 brew bintray 映象
 echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.zshrc
 source ~/.zshrc

# bash 替換 brew bintray 映象
 echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
 source ~/.bash_profile

# 重新整理源
 brew update

3 cocoaPod安裝更新

 brew install cocoapods
 brew upgrade cocoapods

------------恢復內容結束------------