Homebrew常用的命令 | retree 完美删除软件及其所有依赖

Homebrew常用的命令

这里用mysql举例 [formula] --> mysql

  1. 安装:brew install [formula]
  2. 卸载:brew uninstall [formula]
  3. 更新:brew update (更新 Homebrew,使之后下载升级有效)
  4. 升级: brew upgrade (升级list中所有)
  • brew pin [formula] 固定软件
  • brew unpin [formula] 解除固定
  • brew upgrade [formula] 升级某一软件:
  • brew update && brew upgrade && brew cleanup 更新+升级+清理
  1. 待升级:brew outdated (列出已安装中待升级)
  2. 清理:brew cleanup (清理不需要的版本极其安装包缓存)
  3. 列出已装软件列表: brew list
  4. 搜索特定软件:brew search [formula]
  5. 查看依赖包:brew deps [formula] 可以查看该软件的依赖包
  6. 查询:brew info [formula] (主要看具体的信息,比如目前的版本,依赖,安装后注意事项等)
  7. 检查:brew doctor

brew services 管理服务

macOS使用launchctl命令加载开机自动运行的服务,brew service可以简化lauchctl的操作


```c
brew services list  # 查看使用brew安装的服务列表
brew services run formula|--all  # 启动服务(仅启动不注册)
brew services start formula|--all  # 启动服务,并注册
brew services stop formula|--all   # 停止服务,并取消注册
brew services restart formula|--all  # 重启服务,并注册
brew services cleanup  # 清除已卸载应用的无用的配置

## 删除软件及其所有依赖
https://github.com/beeftornado/homebrew-rmtree

#### 安装rmtree:

```c
$ brew tap beeftornado/rmtree && brew install brew-rmtree

使用:

$ brew rmtree <package>

其实我们在终端中便可以轻松查看brew命令的详细介绍,操作如下:

brew 
Example usage:
  brew search [TEXT|/REGEX/]
  brew info [FORMULA...]
  brew install FORMULA...
  brew update
  brew upgrade [FORMULA...]
  brew uninstall FORMULA...
  brew list [FORMULA...]

Troubleshooting:
  brew config
  brew doctor
  brew install --verbose --debug FORMULA

Contributing:
  brew create [URL [--no-fetch]]
  brew edit [FORMULA...]

以下三个是查看详细命令的操作:

Further help:
	'''查看所有命令‘’‘
  brew commands      
  	’‘’查看某一命令详细解释‘’‘  
  brew help [COMMAND]
  	’‘’详细手册‘’‘
  man brew
  https://docs.brew.sh

brew commands所有的命令:


Built-in commands
--cache         commands        install         readall         uninstall
--cellar        config          leaves          reinstall       unlink
--env           deps            link            search          unpack
--prefix        desc            list            sh              unpin
--repository    diy             log             shellenv        untap
--version       doctor          migrate         style           update
analytics       fetch           missing         switch          update-report
cask            gist-logs       options         tap             update-reset
cat             help            outdated        tap-info        upgrade
cleanup         home            pin             tap-pin         uses
command         info            postinstall     tap-unpin       vendor-install

Built-in developer commands
audit               extract             prof                tests
bottle              formula             pull                update-test
bump-formula-pr     irb                 release-notes       vendor-gems
bump-revision       linkage             ruby
create              man                 tap-new
edit                mirror              test

External commands
aspell-dictionaries                      services
postgresql-upgrade-database

查看更详细的说明手册:

man brew

你可能感兴趣的:(Mac,Homebrew,MacOS,Homebrew)