Prerequisites:
- An internet connection
- Administrative privileges on your Mac
Installation Steps:
Option one (no recommend Run the installation script):
- Open Terminal: Go to Applications > Utilities > Terminal.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- This command fetches the latest installation script from GitHub and executes it using the Bourne Again
Shell (
/bin/bash
). - Press Enter when prompted to continue.
- The script will download and install Homebrew, displaying progress messages during the process.
Option two (recommend .pkg installer).
- Download .pkg installer from Homebrew's latest GitHub release
add to your shell profile
Edit your shell profile (e.g.,
~/.bashrc
or~/.zshrc
or~/.zprofile
) and add the following line:eval "$(/opt/homebrew/bin/brew shellenv)"
Then, reload your shell profile for the changes to take effect:
source ~/.bashrc # or source ~/.zshrc or source ~/.zprofile (depending on your shell)
Enter your password (if prompted):
- During installation, you might be prompted to enter your administrator password. Type your password and press Enter.
- The password won't be shown on screen for security reasons.
Verification (Optional):
- Once the installation is complete, you can verify it by running the following command:
brew doctor
- This command checks for any potential issues with your Homebrew installation and provides suggestions if necessary.
Additional Notes:
- The installation script might take a few minutes to complete depending on your internet speed.
- After successful installation, you can close the Terminal window.
Using Homebrew:
Once installed, you can use Homebrew to install various software packages, libraries, and tools on your Mac.
To install a package, use the following command format:
brew install <package_name>
Replace
<package_name>
with the actual name of the package you want to install.For example, to install Python using Homebrew, you would run:
brew install python
You can find a list of available packages and more information about Homebrew on their official website: https://brew.sh/
I hope this helps! Feel free to ask if you have any further questions about using Homebrew.