brew-install
Install software packages using Homebrew
TLDR
Install a formula/cask
Build and install a formula from source (dependencies will still be installed from bottles)
Download the manifest, print what would be installed but don't actually install anything
SYNOPSIS
brew install [options] <formula> ...
Or: brew install --cask <cask> ...
Example: brew install htop
Example: brew install --build-from-source python@3.9
PARAMETERS
formula
The name of the software package (formula) to install. Homebrew will primarily attempt to install a pre-built binary (bottle).
cask
(Primarily for macOS) The name of the application, font, or plugin to install. On Linux, casks are less common as they primarily describe macOS-specific software. This argument requires the --cask option.
--cask
Instructs Homebrew to treat the following argument(s) as a cask rather than a formula.
--debug
Display verbose debug information during the installation process, useful for troubleshooting.
--force-bottle
Force installation of a pre-built bottle even if it's for a different architecture (e.g., ARM bottle on x86_64) or OS. This is generally not recommended unless you understand the implications and potential for instability.
--build-from-source
Compile the specified formula from its source code rather than using a pre-built binary (bottle). This typically requires development tools (e.g., gcc, make) to be installed on your system.
--ignore-dependencies
Install the specified formula without also installing its required dependencies. This can lead to non-functional or broken software.
--only-dependencies
Install only the dependencies of the specified formula but not the formula itself. This is useful for preparing a build environment or for specific development workflows.
--HEAD
Install the `HEAD` version (the latest development snapshot) of a formula directly from its version control repository. This version may be unstable and subject to frequent changes.
--devel
Install the `devel` version (development release) of a formula, if a specific development release version is defined by the formula author.
--help
Show help documentation and available options specific to the brew install command.
DESCRIPTION
Homebrew is a free and open-source package manager that simplifies the installation of software. On Linux, it functions as a versatile alternative or supplement to traditional distribution package managers like apt, dnf, or yum. The brew install command is its core functionality, allowing users to effortlessly download, compile (if necessary), and install thousands of pre-compiled binaries (bottles) or source packages (formulas). It automatically handles dependencies, ensuring all necessary prerequisites for a software package are also installed. This command is particularly useful for obtaining newer versions of software or packages not readily available in official distribution repositories.
CAVEATS
brew install on Linux uses the Homebrew project, which was previously known as Linuxbrew.
Packages are typically installed to a user-specific directory (e.g., /home/linuxbrew/.linuxbrew), which may require adjusting your PATH and other environment variables to ensure executables are found.
Software installed via Homebrew might not integrate seamlessly with system-wide libraries or configurations managed by your distribution's native package manager, potentially leading to conflicts or unexpected behavior.
Building from source (--build-from-source) requires that necessary development tools and compilers (like gcc, make, cmake, etc.) are already installed on your system.
<B>FORMULAS VS. CASKS</B>
Homebrew manages two primary types of software: formulas and casks. Formulas are definitions for command-line tools, libraries, and utilities, which are typically installed from source code or pre-compiled binaries (bottles). Casks (primarily for macOS) are definitions for graphical applications, fonts, or plugins, often installed by simply copying them to standard system locations. While brew install is used for both, the utility of casks on Linux is limited as they describe macOS-specific applications.
<B>TAPS</B>
A tap in Homebrew is a Git repository that contains additional formulas or casks beyond those found in the core Homebrew repositories. Users can 'tap' these repositories using brew tap to expand the range of available software. For example, brew tap homebrew/cask adds the official Cask repository. Once tapped, formulas or casks from that repository become discoverable and installable using the brew install command, fostering a decentralized and community-driven ecosystem for software distribution.
HISTORY
Homebrew originated as a package manager for macOS, created by Max Howell in 2009. Its success and user-friendly design led to the development of Linuxbrew, a port specifically for Linux, by Shaobo Li. For several years, Linuxbrew operated as a separate project with its own repository and installation instructions. Recognizing the benefits of unification, Linuxbrew was officially merged back into the main Homebrew project in 2020. This integration allowed a single Homebrew installation to manage packages on both macOS and Linux, streamlining development and maintenance efforts. The core brew install command has remained a fundamental part of its functionality, adapting over time to support new features and package types.
SEE ALSO
brew update: Updates Homebrew itself and its formula definitions., brew upgrade: Upgrades all currently installed formulas to their latest versions., brew remove (brew uninstall): Uninstalls specified formulas or casks., brew search: Searches for available formulas or casks by name or description., brew info: Displays detailed information about a specific formula or cask., apt(8): The package management system for Debian-based Linux distributions (e.g., Ubuntu)., dnf(8) (yum(8)): The primary package management system for Fedora and RHEL-based Linux distributions.