【mac】homebrew包管理安装
1、官网
https://brew.sh/
Homebrew 源使用帮助 — USTC Mirror Help 文档
2、国内
https://gitee.com/cunkai/HomebrewCN
3、安装
官方
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# 卸载 /bin/bash -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall)" # 自升级 brew upgrade brew
镜像源
/bin/bash -c "$(curl -fsSL https://cdn.jsdelivr.net/gh/ineo6/homebrew-install/install.sh)"
中文安装教程(建议收藏):https://brew.idayer.com/ 如果你想换源,可以使用镜像助手:https://brew.idayer.com/guide/change-source/
4、更新国内源
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 cd "$(brew --repo)/Library/Taps/homebrew/homebrew-cask" git remote set-url origin git://mirrors.tuna.tsinghua.edu.cn/homebrew-cask.git echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.bash_profile source ~/.bash_profile
5、使用
MacBook-Pro ~ % brew help Example usage: brew search TEXT|/REGEX/ brew info [FORMULA|CASK...] brew install FORMULA|CASK... brew update brew upgrade [FORMULA|CASK...] brew uninstall FORMULA|CASK... brew list [FORMULA|CASK...] Troubleshooting: brew config brew doctor brew install --verbose --debug FORMULA|CASK Contributing: brew create URL [--no-fetch] brew edit [FORMULA|CASK...] Further help: brew commands brew help [COMMAND] man brew https://docs.brew.sh
参考链接:
https://blog.csdn.net/Gusand/article/details/119214434
https://www.jianshu.com/p/c460eaa0c354
https://learnku.com/docs/qianxi-golang/2020/macos-domestic-installation-of-homebrew/8033
https://mirrors.tuna.tsinghua.edu.cn/help/homebrew/
https://www.jianshu.com/p/07aa3a64648e
https://mirrors.ustc.edu.cn/help/brew.git.html