How to fix permission-denied issues when executing homebrew commands

person holding green and white pack

I tried to update ddev to the latest version, using brew upgrade ddev in the terminal, and after each attempt I got a permission denied error.

The solution that worked is the following command:

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

Posted

in

by