-
Notifications
You must be signed in to change notification settings - Fork 0
Installing Homebrew
Tip
Initial setup: 1. Updating macOS • 2. Determining your shell • 3. Installing the Xcode CLI Tools • 4. Installing Homebrew
Homebrew is a third-party package manager for macOS. It is used primarily for installing command line software, although it can also be used to install desktop applications. Alternate (and less commonly used) package managers for macOS include MacPorts and Fink.
Important
Installed packages and their versions are available globally across the whole system.
It is analogous to package managers such as yum, dnf, apt-get, or others in Linux. Also Windows Package Manager or Chocolatey in Windows.
The Homebrew website provides a pretty good explanation of how to install and how it generally works.
-
Install Homebrew.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
-
Add the following environment variable definition to your shell's profile.
export HOMEBREW_CASK_OPTS="--no-quarantine"
The Homebrew Manual provides deeper technical details and information.
For example, let's say you want to install the latest release of Python, but you're not sure what the name of the package is. You can search for the keyword.
$ brew search python
==> Formulae
boost-python3 python-setuptools
bpython python-tabulate
cyclonedx-python python-tk@3.10
ipython python-tk@3.11
libvirt-python python-tk@3.12
micropython python-tk@3.13
ptpython python-tk@3.9
python-argcomplete python-yq
python-build python@3.10
python-gdbm@3.11 python@3.11
python-gdbm@3.12 python@3.12
python-gdbm@3.13 python@3.13
python-launcher python@3.8
python-lsp-server python@3.9
python-lxml reorder-python-imports
python-markdown wxpython
python-matplotlib pythran
python-packaging cython
python-ply jython
==> Casks
mysql-connector-python
From here, we can see that the latest release of Python is python@3.13
. So let's install it.
brew install python@3.13
Homebrew will automatically handle installation, as well as adding it to your $PATH
so that it shows up when you begin typing the name, then hit Tab to auto-complete the command name.
If something about your installation gets messed-up, you can try reinstalling it from scratch.
Tip
This only works for packages that are already installed.
brew reinstall python@3.13
If you want to remove a piece of software (or a version of software which contains an @
in the name), use the uninstall
sub-command.
brew uninstall python@3.13