How to install homebrew (brew) on M1 Mac


Homebrew now provides native support for MacBooks with M1 Silicon, installing brew on macOS Big Sur is simple, just open terminal and run the below command,

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

You will be prompted to enter password when you run the command and all required tools and packages will be installed.

Installing homebrew M1 Mac
Installing homebrew M1 Mac
[email protected] / % /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Password:

==> This script will install:
/opt/homebrew/bin/brew
/opt/homebrew/share/doc/homebrew
/opt/homebrew/share/man/man1/brew.1
/opt/homebrew/share/zsh/site-functions/_brew
/opt/homebrew/etc/bash_completion.d/brew
/opt/homebrew

==> The following new directories will be created:
/opt/homebrew/bin
/opt/homebrew/etc
/opt/homebrew/include
/opt/homebrew/lib
/opt/homebrew/sbin
/opt/homebrew/share
/opt/homebrew/var
/opt/homebrew/opt
/opt/homebrew/share/zsh
/opt/homebrew/share/zsh/site-functions
/opt/homebrew/var/homebrew
/opt/homebrew/var/homebrew/linked
/opt/homebrew/Cellar
/opt/homebrew/Caskroom
/opt/homebrew/Frameworks
==> The Xcode Command Line Tools will be installed.

Press RETURN to continue or any other key to abort

 * [new tag]             3.0.0                                               -> 3.0.0
HEAD is now at 3bcd919a7 Merge pull request #10578 
from MikeMcQuaid/formula_bottle_hash
==> Tapping homebrew/core
remote: Enumerating objects: 39, done.
remote: Counting objects: 100% (39/39), done.
remote: Compressing objects: 100% (26/26), done.
remote: Total 906603 (delta 21), reused 26 (delta 13), pack-reused 906564
Receiving objects: 100% (906603/906603), 360.00 MiB | 916.00 KiB/s, done.
Resolving deltas: 100% (617458/617458), done.
From https://github.com/Homebrew/homebrew-core
 * [new branch]      master     -> origin/master
HEAD is now at f1b2a2e9b3 ffmpeg: update 4.3.1_9 bottle.
Warning: /opt/homebrew/bin is not in your PATH.
==> Installation successful!

==> Homebrew has enabled anonymous aggregate formulae and cask analytics.
Read the analytics documentation (and how to opt-out) here:
  https://docs.brew.sh/Analytics
No analytics data has been sent yet (or will be during this `install` run).

==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
  https://github.com/Homebrew/brew#donations

==> Next steps:
- Add Homebrew to your PATH in /Users/code2care/.zprofile:
    echo 'eval $(/opt/homebrew/bin/brew shellenv)' >> /Users/code2care/.zprofile
    eval $(/opt/homebrew/bin/brew shellenv)
- Run `brew help` to get started
- Further documentation: 
    https://docs.brew.sh

Make sure you add the brew installation dir to PATH: Follow this article to do so: https://code2care.org/howto/fix-command-not-found-brew-bash-zsh-on-macos-terminal