Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install homebrew on M1 mac

Tags:

homebrew

I just got a new Mac, the M1 Macbook pro and I am trying to install homebrew, but every time I finish installing it, it tells me that it was not written to the path, and then when I try the advised whatever to add to the path, nothing happens and the terminal or whatever does not recognize the command at all, as if it isn't installed.

This worked perfectly fine on my old Intel mac, and there is some step or whatever - I don't know anything, and I am tired and I don't understand how to install this at all, but hte path is supposed to be different for Apple silicon macs but nothing i read helps at all.

like image 587
ema1982 Avatar asked Mar 17 '21 02:03

ema1982


People also ask

Can I install Homebrew on M1 Mac?

Now, on your new M1 Mac, you can install Homebrew with /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" . After the install is complete you'll see a message similar to the one below. Remember, Homebrew is now going to install packages in /op/homebrew/bin .

How to install homebrew on macOS Catalina or M1?

How to install Homebrew on macOS Catalina or M1 Mac Open Terminal and enter this command xcode-select --install Click Install from the popup. Go through the T&C and click Agree if you do.

What is homebrew on Mac?

Homebrew is a package manager for macOS which lets you install free and open-source software using your terminal. You’ll use Homebrew to install developer tools like Python, Ruby, Node.js, and more. In this tutorial you’ll install and use Homebrew on your Mac. You’ll install system tools and desktop applications from the command line interface.

How do I install a tree in homebrew on macOS?

Homebrew will update its list of packages and then download and install the tree command: Homebrew installs files to /usr/local by default, so they won’t interfere with future macOS updates. Verify that tree is installed by displaying the command’s location with the which command:

How do I know if Brew is installed on Mac?

Open Terminal and type brew -v You will see the version of Homebrew installed on your Mac. Tip: brew doctor lets you know about Homebrew status, issues, and updates, if available or required. Now that you have installed Homebrew, let’s see how to use it.


Video Answer


2 Answers

Homebrew installation on apple silicon, step by step:

  • Open a terminal window (it should be zsh)
  • Run this command:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

In my case, installation show me errors, I just installed again, and then show: Installation successful!, and warning: /opt/homebrew/bin is not in your PATH

  • Then create .zshrc on home directory (If it was not created yet). Just run on terminal:
touch ~/.zshrc
  • Then open it to edit with TextEdit (Is a hidden file. You can show hidden files with shift + command + . )

  • Add this line at the end of .zshrc

export PATH=/opt/homebrew/bin:$PATH
  • Run this command in terminal to make this available:
source ~/.zshrc
  • Now just run this command to be sure that everything is working:
brew help

This works for me to path homebrew permanently.

Or do:

- Add Homebrew to your PATH in ~/.zprofile:
    echo 'eval $(/opt/homebrew/bin/brew shellenv)' >> ~/.zprofile
    eval $(/opt/homebrew/bin/brew shellenv)
like image 181
Camilo Lizarazo Olaya Avatar answered Oct 07 '22 13:10

Camilo Lizarazo Olaya


Seems Touch, source and export not required now. Run the below command in terminal

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

and follow the instructions showing in terminal itself. shows as follows:

==> Next steps:
 Run these two commands in your terminal to add Homebrew to your PATH:

    echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/xxx/.zprofile
    eval "$(/opt/homebrew/bin/brew shellenv)"

Then, brew help

like image 63
name-it Avatar answered Oct 07 '22 12:10

name-it