新入手了mac, 特记录使用过程中遇到的坑

第一步就是安装brew,使用github那个地址,一直报错,这里耗费了一些时间

使用下面的命令行

/bin/bash -c "$(curl -fsSL https:///gh/ineo6/homebrew-install/)"

如果上面安装异常,替换为国内源

替换为中科大源
# 替换各个源
$ 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
 


清华源: https://mirrors.tuna.tsinghua.edu.cn/help/homebrew/

阿里云: https://developer.aliyun.com/mirror/homebrew/