## 安装homebrew 参考: - https://www.jianshu.com/p/e0471aa6672d 国内镜像安装命令: ```c++ /bin/bash -c "$(curl -fsSL https://gitee.com/ineo6/homebrew-install/raw/master/install.sh)" ``` 安装完之后需要替换源: ### 1.必备设置 - 替换 brew.git: ```bash git -C "$(brew --repo)" remote set-url origin https://mirrors.ustc.edu.cn/brew.git ``` - 替换 homebrew-core.git: ```bash git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git ``` ### 2.按需设置 - 替换 homebrew-cask.git: ```bash git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git ``` - 替换homebrew-bottles: 首先要先区分你的mac用哪种终端工具,如果是 bash,则执行: ```bash echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile source ~/.bash_profile ``` 若是 zsh,则执行: ```bash echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.zshrc source ~/.zshrc