skip to Main Content

Homebrew gives me this error on macOS Monterey while using it:

Error: Permission denied @ apply2files - /usr/local/lib/docker/cli-plugins

How can I fix it?

2

Answers


  1. Chosen as BEST ANSWER

    As written here https://flaviocopes.com/homebrew-fix-permission-denied-apply2files/ ,

    if you had recently deleted Docker, you have to manually recreate the Docker folder:

    mkdir -p /Applications/Docker.app/Contents/Resources/cli-plugins
    

    Then run

    brew cleanup
    

    You should have fixed the issue!

    After that, you can delete the Docker application inside the Application folder


  2. As noted by @JW, the accepted answer above…

    mkdir -p /Applications/Docker.app/Contents/Resources/cli-plugins
    

    Then running

    brew cleanup
    

    Does not work for everyone (and did not work for me). What did work is what they suggested:

    Instead, I deleted sudo rm -r /usr/local/lib/docker/cli-plugins, which
    was a symlink to that (non-existent) Docker.app subdirectory.

    Here is the code to run:

    sudo rm -r /usr/local/lib/docker/cli-plugins
    

    As JW suggested, this link explains more: https://github.com/Homebrew/homebrew-core/issues/45009

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search