homebrew常用命令

1.安装

//安装依赖工具
xcode-select --install

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

2.查看帮助信息

brew help

3.查看版本

brew -v

4.更新Homebrew自己

brew udpate

5.安装软件包

brew install [包名]

//安装git
brew install git

//安装git-lfs
brew install git-lfs

//安装wget
brew install wget

//安装openssl
brew install openssl

6.查询可更新的包

brew outdated

7.更新包 (formula)

//更新所有
brew upgrade

//更新指定包
brew upgrade [包名]

8.清理旧版本

//清理所有包的旧版本
brew cleanup 

//清理指定包的旧版本
brew cleanup [包名]

//查看可清理的旧版本包,不执行实际操作
brew cleanup -n 

9.锁定不想更新的包

//锁定某个包
brew pin $FORMULA  
//取消锁定
brew unpin $FORMULA  

10.卸载安装包

brew uninstall [包名]

//例:卸载git
brew uninstall git

11.查看包信息

brew info [包名]

12.查看安装列表

brew list

13.查询可用包

brew search [包名]

14.卸载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

 

 

posted @ 2021-12-03 16:59  残宠魔法袋  阅读(317)  评论(0编辑  收藏  举报