macOS 安装配置 Homebrew
安装 Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"配置 Homebrew
关闭自动更新
echo 'export HOMEBREW_NO_AUTO_UPDATE=true' >> ~/.zshrc
source ~/.zshrc加速 Homebrew 更新
# 替换 brew.git
cd "$(brew --repo)"
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
# 替换 homebrew-core.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
# 替换 homebrew-cask.git
# 需执行过 `brew cask` 命令安装 brew-cask 后才会有
# brew-cask 用于安装 macOS 二进制文件(如带 GUI 的大型应用程序)
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-cask"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git加速软件包下载
Homebrew 常用命令
更新 Homebrew
安装软件包
更新软件包
卸载软件包
查看软件包
清除缓存
符号链接
异常处理
权限不足
参考文献
Last updated