執行brew update后顯示Permission denied


執行brew update后顯示如下:

touch: /usr/local/.git/FETCH_HEAD: Permission denied
error: cannot open .git/FETCH_HEAD: Permission denied

/usr/local/Library/Homebrew/cmd/update.sh: line 514: /usr/local/.git/UPDATE_FAILED: Permission denied
touch: /usr/local/Library/Taps/homebrew/homebrew-nginx/.git/FETCH_HEAD: Permission denied
error: cannot open .git/FETCH_HEAD: Permission denied

/usr/local/Library/Homebrew/cmd/update.sh: line 514: /usr/local/.git/UPDATE_FAILED: Permission denied
==> Homebrew has enabled anonymous aggregate user behaviour analytics.
Read the analytics documentation (and how to opt-out) here:
  http://docs.brew.sh/Analytics.html

error: could not lock config file .git/config: Permission denied
Error: Failure while executing: git config --local --replace-all homebrew.analyticsmessage true

解決辦法:

執行以下命令即可解決問題

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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM