
So to sum up, when we configure Homebrew environment variables, we need to make corresponding configurations according to different situations, as follows:Įcho 'eval "$(/opt/homebrew/bin/brew shellenv)"' > ~/.zprofileĮval "$(/opt/homebrew/bin/brew shellenv)"Įcho 'eval "$(/opt/homebrew/bin/brew shellenv)"' > ~/.bash_profileĮcho 'eval "$(/usr/local/Homebrew/bin/brew shellenv)"' > ~/.zprofileĮval "$(/usr/local/Homebrew/bin/brew shellenv)"Įcho 'eval "$(/usr/local/Homebrew/bin/brew shellenv)"' > ~/.bash_profileĮval "$(/usr/local/Homebrew/bin/brew shellenv)" 3. The M1 chip ARM version of Homebrew will eventually be installed under the /opt/homebrew path, while the previous Intel chip Mac will be installed under the /usr/local/Homebrew path. In addition, we also need to determine the model of our computer CPU, which can be viewed through uname -m, as follows Starting from macOS Catalina (10.15.x), Mac uses /bin/zsh as the default shell, and its corresponding The configuration file is ~/.zshrc In the past, the default shell for each new user was /bin/bash, so here we need to configure the file as ~/.bash_profile. Here, you need to use the echo $SHELL that was introduced before to confirm the terminal type, as follows
#Homebrew for mac download install
Download and install the official script and configure environment variablesįirst of all, we can enter the official website address: to get the download link, as follows:Īfter the installation is complete, if you encounter an error of command not found: brew, it is generally because the environment variable is invalid. There are four main parts: brew, homebrew-core, homebrew-cask, homebrew-bottlesĢ.


Homebrew is a package management tool that currently supports macOS and Linux systems. For mirror download, domain name resolution, and time synchronization, please click Alibaba Cloud Open Source Mirror Site 1.
