Mac上Homebrew常用命令
官方网址
常用命令
- 安装(官方方法)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- 查看帮助信息
ivan@ivandeMBP /etc %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
- 查看版本
ivan@ivandeMBP /etc %brew -v
Homebrew 3.6.4
Homebrew/homebrew-core (git revision 75b54ae5d3c; last commit 2022-10-04)
- 更新Homebrew自己
brew update
- 安装软件包
brew install [包名]
//安装git
brew install git
//安装git-lfs
brew install git-lfs
//安装wget
brew install wget
//安装openssl
brew install openssl
- 查询可更新的包
brew outdated
- 更新包 (formula)
//更新所有
brew upgrade
//更新指定包
brew upgrade [包名]
- 清理旧版本
//清理所有包的旧版本
brew cleanup
//清理指定包的旧版本
brew cleanup [包名]
//查看可清理的旧版本包,不执行实际操作
brew cleanup -n
- 锁定不想更新的包
//锁定某个包
brew pin $FORMULA
//取消锁定
brew unpin $FORMULA
- 卸载安装包
brew uninstall [包名]
//例:卸载git
brew uninstall git
- 查看包信息
brew info [包名]
- 查看安装列表
brew list
- 查询可用包
brew search [包名]
- 卸载Homebrew
cd `brew --prefix`
rm -rf Cellar
brew prune
rm `git ls-files`
rm -r Library/Homebrew Library/Aliases Library/Formula Library/Contributions
rm -rf .git
rm -rf ~/Library/Caches/Homebrew
标签:git,常用命令,CASK,Mac,install,FORMULA,brew,Homebrew
From: https://www.cnblogs.com/alvisClub/p/17092065.html