最終更新:2023-10-05 (木) 09:26:31 (196d)  

brew
Top / brew

パッケージのインストール

$ brew install wget

コマンド

  • brew installInstall a formula or cask. Additional options specific to a formula may be appended to the command.
    brew updateFetch the newest version of Homebrew and all formulae from GitHub using git(1) and perform any necessary migrations.
    brew upgrade?Upgrade outdated casks and outdated, unpinned formulae using the same options they were originally installed with, plus any appended brew formula options.
    brew list

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

インストール時のエラー

  • Error: 
      homebrew-core is a shallow clone.
    To `brew update`, first run:
      git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
    This command may take a few minutes to run due to the large size of the repository.
    This restriction has been made on GitHub's request because updating shallow
    clones is an extremely expensive operation due to the tree layout and traffic of
    Homebrew/homebrew-core and Homebrew/homebrew-cask. We don't do this for you
    automatically to avoid repeatedly performing an expensive unshallow operation in
    CI systems (which should instead be fixed to not use shallow clones). Sorry for
    the inconvenience!
    Failed during: /usr/local/bin/brew update --force --quiet

インストール

  • $ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
    ==> This script will install:
    /usr/local/bin/brew
    /usr/local/Library/...
    /usr/local/share/man/man1/brew.1
    ==> The following directories will be made group writable:
    /usr/local/.
    /usr/local/bin
    /usr/local/lib
    /usr/local/share
    ==> The following directories will have their group set to admin:
    /usr/local/.
    /usr/local/bin
    /usr/local/lib
    /usr/local/share
    
    Press RETURN to continue or any other key to abort
    ==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/. /usr/local/bin /usr/local/lib /usr/local/share
    
    WARNING: Improper use of the sudo command could lead to data loss
    or the deletion of important system files. Please double-check your
    typing when using sudo. Type "man sudo" for more information.
    
    To proceed, enter your password, or type Ctrl-C to abort.
    
    Password:
    ==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/. /usr/local/bin /usr/local/lib /usr/local/share
    ==> /usr/bin/sudo /bin/mkdir /Library/Caches/Homebrew
    ==> /usr/bin/sudo /bin/chmod g+rwx /Library/Caches/Homebrew
    ==> Downloading and installing Homebrew...
    remote: Counting objects: 169923, done.
    remote: Compressing objects: 100% (47503/47503), done.
    remote: Total 169923 (delta 121314), reused 169894 (delta 121293)
    Receiving objects: 100% (169923/169923), 32.74 MiB | 2.53 MiB/s, done.
    Resolving deltas: 100% (121314/121314), done.
    From https://github.com/Homebrew/homebrew
     * [new branch]      master     -> origin/master
    HEAD is now at 18447a9 Drop emacs dep audit
    ==> Installation successful!
    ==> Next steps
    Run `brew doctor` before you install anything
    Run `brew help` to get started

ヘルプ

$ brew help
Example usage:
  brew [info | home | options ] [FORMULA...]
  brew install FORMULA...
  brew uninstall FORMULA...
  brew search [foo]
  brew list [FORMULA...]
  brew update
  brew upgrade [FORMULA...]
  brew pin/unpin [FORMULA...]

Troubleshooting:
  brew doctor
  brew install -vd FORMULA
  brew [--env | config]

Brewing:
  brew create [URL [--no-fetch]]
  brew edit [FORMULA...]
  open https://github.com/Homebrew/homebrew/wiki/Formula-Cookbook

Further help:
  man brew
  brew home