The correct way, install homebrew on apple m1.
# We'll be installing Homebrew in the /opt directory. cd /opt # Create a directory for Homebrew. This requires root permissions. sudo mkdir homebrew # Make us the owner of the directory so that we no longer require root permissions. sudo chown -R $(whoami) /opt/homebrew