Homebrew
Last updated
Was this helpful?
Last updated
Was this helpful?
is the package manager for macOS and is an essential tool for any developer.
Verify installation of Command Line Tools for Xcode
The ~/.zshrc doesn’t exist by default in macOS, so you need to create it.
Go to Terminal and run:
Not install brew from Terminal
For first time only, run following commands
This will create
~/.zprofile
file if it not exists or appendeval "$(/opt/homebrew/bin/brew shellenv)"
line to existing~/.zprofile
file
Once the installation is successful, run the following command:
If you get Your system is ready to brew.
, you can move on to the next step.
Brew anonymously collect User Behaviour data. To prevent analytics from ever being sent, run:
Brew installs completions and functions into: /opt/homebrew/share/zsh/site-functions
when a formula offers them.
To make Homebrew’s completions available in zsh, you must insert the Homebrew-managed zsh/site-functions
path into your FPATH
before initialising zsh’s completion facility. Add the following to your ~/.zshrc
:
Note that, this snippet must be added in the top if
~/.zshrc
[!CAUTION] Installing homebrew in non-standared location like below, will cause some packages not work properly.
If you don't have admin/sudo access to your laptop(e.g., company issued laptop), recomend installing brew in your home directory. In this case follow these steps
Then add brew to front of PATH by editing your shell profile file: .zprofile
and adding below line:
Troubleshooting:
Example usage:
Homebrew keeps older versions of formulas installed on your system, in case you want to roll back to an older version. That is rarely necessary, so you can do some cleanup to get rid of those old versions:
for external Homebrew commands are not automatically installed. To opt-in to using completions for external commands (if provided), they need to be linked to HOMEBREW_PREFIX
by running brew completions link
.