Installing Brew on Mac

Reza Rezvani
2 min readJan 27, 2023

To install Brew (Homebrew) on your Mac, you will need to have Xcode Command Line Tools installed. These tools can be installed by running the following command in your terminal:

xcode-select --install

This command will prompt you to install the Xcode Command Line Tools. Once the installation is complete, you can proceed with installing Brew by running the following command in your terminal:

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

This command will download and run the Brew installation script. You will need to press “Enter” to continue the installation process. Brew will then download and install all the necessary files on your computer.

Please note that you’ll need to have administrative access to your mac. This is needed to install new software and make changes to the system.

Once the installation is complete, you can use the brew command to manage and install software packages. For example, you can use the brew install command to install new software, and the brew list command to see a list of all the software packages you have installed.

What to do, if brew is not running on your mac

There could be a few reasons why Brew is not running on your Mac. Here are a few things you can try to troubleshoot the issue:

  1. Check if Brew is installed on your computer: Open a terminal window and type brew -v. If Brew is installed, you should see the version number displayed. If you see an error message instead, then Brew is not installed.
  2. Check the system PATH variable: Brew may be installed, but it may not be in your system’s PATH variable, which means that the terminal doesn’t know where to find it. To check this, type echo $PATH in your terminal. You should see /usr/local/bin in the list of directories. If you don't, you can add it to your .bash_profile or .bashrc file.
echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.bash_profile

and then reload the terminal

source ~/.bash_profile
  1. Check for permissions issue: Brew requires administrative access to run. Make sure you have administrative access to your mac.
  2. Conflicting software: There may be another package manager installed on your system that is conflicting with Brew, such as MacPorts. You can check if MacPorts is installed by typing port -v in your terminal. If it is installed, you will need to either uninstall MacPorts or configure your system to use Brew instead.
  3. If none of these solutions work, you may want to consider reinstalling Brew. You can do this by running the installation command again
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Please let me know if you have any other issues or if you need further assistance.

Happy coding!

Reza Rezvani — Jan. 2023, Berlin

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Reza Rezvani
Reza Rezvani

Written by Reza Rezvani

As CTO of a Berlin AI MedTech startup, I tackle daily challenges in healthcare tech. With 2 decades in tech, I drive innovations in human motion analysis.

No responses yet

Write a response