루트로 설치 한 후 Homebrew 권한을 복구하는 방법 Permission denied Error: Failed to update tap: caskroom/cask $

나는 brew를 루트로 실행합니다. 이제 소멸되었습니다. 더 이상 업데이트가 없습니다. 어떻게 고치는 지?

$ brew update && brew upgrade
error: Unable to append to .git/logs/HEAD: Permission denied
error: Unable to append to .git/logs/refs/remotes/origin/master: Permission denied
Error: Failed to update tap: caskroom/cask

$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!

Warning: Your XQuartz (2.7.4) is outdated
Please install XQuartz 2.7.7:
  https://xquartz.macosforge.org


답변

/ usr / local 및 Homebrew의 캐시 권한을 현재 사용자에게 재설정하십시오.

sudo chown -R $USER:admin /usr/local /Library/Caches/Homebrew

답변

최악의 경우 Homebrew를 다시 설치하십시오. 내 경우에 도움이되었습니다.

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