Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing Homebrew on OS X

According to the Homebrew site, to install it, I need to type:

brew install wget 

I get an error message:

-bash: brew: command not found 

Found this answer. The problem, however, is I don't see brew in /usr/local/bin.

I added the below line to my .bashrc file

export PATH=/usr/local/bin:$PATH 

Still getting the command not found error.

How do I install Homebrew on OS X?

like image 561
DBWeinstein Avatar asked Dec 04 '13 16:12

DBWeinstein


People also ask

Where should I install Homebrew on my Mac?

On Mac Intel, Homebrew installs itself into the /usr/local/bin directory, which is already configured for access by the shell with the macOS default $PATH environment variable (the default is set by the /usr/libexec/path_helper command).

Is Brew installed on Mac by default?

Manage your command-line utilities with brewHomebrew boasts that it "installs the stuff you need that Apple (or your Linux system) didn't" install by default. Installation happens with the brew command, which gives us access to thousands of command-line utilities, but not more complex applications.

How long does Homebrew take to install on Mac?

Homebrew installation takes 2 to 15 minutes.


2 Answers

It's on the top of the Homebrew homepage.

From a Terminal prompt:

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

The command brew install wget is an example of how to use Homebrew to install another application (in this case, wget) after brew is already installed.


Historic...

Before about 2020, the command given on the Homebrew page was:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 
like image 173
Jay Harris Avatar answered Oct 11 '22 16:10

Jay Harris


If you are using m1 chip mac then run below command after installing homebrew and open the terminal again:

echo "export PATH=/opt/homebrew/bin:$PATH" >> ~/.zshrc 
like image 36
Awadesh Avatar answered Oct 11 '22 16:10

Awadesh