Installing brew on M1/M2 ARM Mac


Install Brew on Mac

If you have an ARM-based M1 or M2 Apple Silicon Mac and want to install Brew (homebrew) follow the below steps,

  1. Open Terminal App,
  2. Now run the script:
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

    Source: https://github.com/homebrew/install#uninstall-homebrew

  3. Now open .zshrc profile file to set brew PATH permanently,
    nano ~/.zshrc

    Add this line to the file export PATH=/opt/homebrew/bin:$PATH

  4. Now reload your shell: source ~/.zshrc
  5. Try running brew version command to see if got installed correctly.
  6. % brew --version    
    Homebrew 3.5.10
    Homebrew/homebrew-core (git revision ccafaef56d8; last commit 2022-09-04)

If the path is not set correctly or brew is not installed properly you will get an error like,

brew --version
zsh: command not found brew


Have Questions? Post them here!
Advertisements
Try Out Code2care Dev Tools:

Advertisements

Advertisements
Code2care is an initiative to publish and share varied knowledge in programming and technical areas gathered during day-to-day learnings and development activities.

Students and software developers can leverage this portal to find solutions to their various queries without re-inventing the wheel by referring to our easy to understand posts. Technical posts might include learnings, tutorials, trouble-shooting steps, video tutorials, code snippets, how-to, blogs, articles, etc.

🎉 We are celebrating the 10th years of Code2care! Thank you for all your support!

We strongly support Gender Equality & Diversity.