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
posted @ 2021-10-25 11:33  嗯呐东子  阅读(197)  评论(0)    收藏  举报