Error of “error: could not lock config file .git/config: Permission denied” occurs while installing Carthage

前端 未结 7 714
时光取名叫无心
时光取名叫无心 2020-12-24 01:38

I want to install carthage on my Mac OS using brew install carthage command. However, I get the following error:

touch: /usr/local/Homebrew/.git         


        
相关标签:
7条回答
  • 2020-12-24 01:45

    In High Sierra, run the command:

    sudo chown -R $(whoami) $(brew --prefix)/*
    
    0 讨论(0)
  • 2020-12-24 01:49

    You can use this also instead sudo chown -R $USER $(brew --prefix)/*

    0 讨论(0)
  • 2020-12-24 01:54

    I have macOS Catalina 10.15.1 after hours (like always) this worked.

    sudo chown -R $(whoami):admin /usr/local/* && sudo chmod -R g+rwx /usr/local/*

    0 讨论(0)
  • 2020-12-24 02:01

    Check for the permissions on these files.

    ls -l /usr/local/Homebrew/.git/FETCH_HEAD
    ls -l /usr/local/Homebrew/Library/Taps/caskroom/homebrew-cask/.git/FETCH_HEAD
    ls -l /usr/local/Homebrew/Library/Taps/dart-lang/homebrew-dart/.git/FETCH_HEAD
    ls -l /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/.git/FETCH_HEAD
    

    If you don't have the permissions, run

    sudo chown -R $(whoami):admin /usr/local/* && sudo chmod -R g+rwx /usr/local/*
    

    In High Sierra, Run this command instead:

    sudo chown -R $(whoami) $(brew --prefix)/*
    

    You can also see the related github issues here

    0 讨论(0)
  • 2020-12-24 02:01

    This worked for me : macOS Catalina 10.15.1

    sudo chown -R $(whoami):admin /usr/local/* && sudo chmod -R g+rwx /usr/local/*
    
    0 讨论(0)
  • 2020-12-24 02:07

    I have High Sierra and only this worked for me.

    1. sudo chown -R $(whoami):admin /usr/local/* && sudo chmod -R g+rwx /usr/local/*
    you should not write sudo before brew the right command is 
    2. brew install mysql
    

    0 讨论(0)
提交回复
热议问题