Ask Your Question

Revision history [back]

  1. Open Terminal on your Mac.
  2. Run the following command to install Homebrew and create a new directory in /opt:

    sudo mkdir /opt/homebrew && sudo chown -R $(whoami) /opt/homebrew
    
  3. Install Homebrew by running the following command:

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    
  4. Once installation is complete, add the Homebrew bin directory to your PATH variable by running the following command:

    echo 'export PATH="/opt/homebrew/bin:$PATH"' >> ~/.zshrc
    
  5. Close and re-open Terminal for the changes to take effect.

  6. To verify that Homebrew is installed correctly, run the following command:

    brew doctor
    

    If everything is installed correctly, you should see a "Your system is ready to brew" message.