brew update && brew upgrade && brew cleanup
brew list # 설치된 패키지 목록 조회
brew list --full-name
brew info <package-name> # 설치된 패키지 정보 조회
brew search <formula> # 패키지 검색
GUI 프로그램용 확장 기능. cask
? (특히 술을 담아 두는 나무로 된) 통.
brew cask info <package-name>
brew cask list <formula> # 설치된 패키지 목록 조회
brew update
# touch: /usr/local/Homebrew/.git/FETCH_HEAD: Permission denied
# error: cannot open .git/FETCH_HEAD: Permission denied
# /usr/local/Homebrew/Library/Homebrew/cmd/update.sh: line 548: /usr/local/Homebrew/.git/UPDATE_FAILED: Permission denied
ls -l $(brew --prefix)
# 여타 중요한 것 없다면
sudo chown -R $(whoami):admin $(brew --prefix)/*
# sudo chown -R $(whoami):admin /usr/local/Caskroom
# sudo chown -R $(whoami):admin /usr/local/Cellar
# sudo chown -R $(whoami):admin /usr/local/Homebrew
brew upgrade
# [...]
# cp: utimes: /usr/local/Cellar/[email protected]/.: Operation not permitted
sudo chown -R $(whoami):admin /usr/local/Cellar
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!
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 && brew upgrade && brew cleanup