Skip to content

Instantly share code, notes, and snippets.

@markruler
Last active April 28, 2021 00:54
Show Gist options
  • Save markruler/d02ab15c9d31d314d5cd9152de0afad9 to your computer and use it in GitHub Desktop.
Save markruler/d02ab15c9d31d314d5cd9152de0afad9 to your computer and use it in GitHub Desktop.
Homebrew `update`

Homebrew

Daily

brew update && brew upgrade && brew cleanup

brew

brew list # 설치된 패키지 목록 조회
brew list --full-name
brew info <package-name> # 설치된 패키지 정보 조회
brew search <formula> # 패키지 검색

brew cask

GUI 프로그램용 확장 기능. cask? (특히 술을 담아 두는 나무로 된) 통.

brew cask info <package-name>
brew cask list <formula> # 설치된 패키지 목록 조회

Issues

"Permission denied"

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

"Operation not permitted"

brew upgrade
# [...]
# cp: utimes: /usr/local/Cellar/[email protected]/.: Operation not permitted
sudo chown -R $(whoami):admin /usr/local/Cellar

"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!
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment