JasonWu73/Blog

Homebrew

JasonWu73 opened this issue · 0 comments

brew - The Missing Package Manager for macOS (or Linux)

Install Homebrew

xcode-select --install
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Install package

包类型分为两种:

  • Formulae (homebrew/core): Typically deal with command-line software
  • Casks (homebrew/cask): Extension of homebrew that to install mac OS native applications

基本上的命令都支持以下两个options:

  • --formula: Treat all named arguments as formulae
  • --cask: Treat all named arguments as casks

常用命令:

  • brew install formula: Install formula
  • brew uninstall formula: Uninstall formula
  • brew list: List all installed formulae
  • brew search [text|/text/]: Perform a substring (or regex) search
  • brew info [formula|cask]: Display brief statistics for your Homebrew installation
  • brew home [formula|cask]: Open a formula or cask's homepage in a browser
  • brew update: Fetch the newest version of Homebrew and all formulae from GitHub
  • brew outdated: List installed casks and formulae that have an updated version available
  • brew upgrade: Upgrade outdated casks and outdated, unpinned formulae
  • brew doctor: Check your system for potential problems
  • brew autoremove: Uninstall formulae that were only installed as a dependency of another formula and are now no longer needed
  • brew cleanup: Remove stale lock files and outdated downloads for all formulae and casks, and remove old versions of installed formulae