Skip to content

Homebrew

How to install brew

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

중요한 점은 관리자 권한(sudo)을 사용하지 않는 것이다.

Help message

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...]
  https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Formula-Cookbook.md

Further help:
  man brew
  brew home

List of Packages

wxMac

$ brew install wxmac

OpenCV

$ brew tap homebrew/science
$ brew install opencv

FFmpeg

$ brew install ffmpeg

Homebrew private repository

Troubleshooting

The linking step did not complete successfully

패키지 설치 도중 아래와 같은 에러메시지가 출력되면서 설치를 실패할 수 있다.

The linking step did not complete successfully
The formula built, but is not symlinked into /usr/local

관련 메시지로, Permission denied가 출력될 수 있다. 이 경우 아래와 같이 우선 업데이트를 진행한 한다.

$ brew update

이 후, 재시도했을 경우 정상적으로 설치되지 않는다면 아래와 같이 chown를 사용하여 소유권을 변경한다.

$ sudo chown -R $(whoami):admin /usr/local

homebrew-core is a shallow clone

brew update명령을 날리면 다음과 같은 에러가 발생될 수 있다.

Error:
  homebrew-core is a shallow clone.
  homebrew-cask is a shallow clone.
To `brew update`, first run:
  git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
  git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow
These commands may take a few minutes to run due to the large size of the repositories.
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!

번역하면:

  • 이러한 명령은 저장소 크기가 크기 때문에 실행하는 데 몇 분 정도 걸릴 수 있습니다.
  • 얕은 클론을 업데이트하는 것은 Homebrew/homebrew-coreHomebrew/homebrew-cask의 트래픽과 트리 레이아웃으로 인해 매우 비용이 많이 드는 작업이기 때문에 GitHub의 요청에 따라 이러한 제한이 적용되었습니다.
  • CI 시스템에서 값 비싼 얕은 작업을 반복적으로 수행하지 않도록 자동으로 수행하지 않습니다 (대신 얕은 클론을 사용하지 않도록 수정해야 함).

따라서 다음과 같이 다시 해보자:

git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow
brew update

See also

Favorite site