# 查看brew
brew -v
# 安装brew
ruby -e \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)\"
# 查看源
git -C "$(brew --repo)" remote -v
# origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git (fetch)
# origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git (push)
# 修改为清华源
git -C "$(brew --repo)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git
brew update
# 修改为原始源
git -C "$(brew --repo)" remote set-url origin https://github.com/Homebrew/brew.git
git -C "$(brew --repo homebrew/core)" remote set-url origin https://github.com/Homebrew/homebrew-core.git
git -C "$(brew --repo homebrew/cask)" remote set-url origin https://github.com/Homebrew/homebrew-cask.git
brew update
# 搜索包资源
brew search <package>
# 查看安装包
brew list
# 安装包
brew install <package>
# 卸载包
brew uninstall <package>
# 更新
brew update
# brew诊断修复
brew doctor
mac 安装homebrew
最新推荐文章于 2023-10-10 20:30:00 发布