LinuxCommandLibrary

brew-install

Install software packages using Homebrew

TLDR

Install a formula/cask

$ brew install [formula|cask]
copy

Build and install a formula from source (dependencies will still be installed from bottles)
$ brew install [[-s|--build-from-source]] [formula]
copy

Download the manifest, print what would be installed but don't actually install anything
$ brew install [[-n|--dry-run]] [formula|cask]
copy

SYNOPSIS

brew install [options] formula ...

PARAMETERS

-v, --verbose
    Print verbose install steps

--debug
    Enable debugging output

-f, --force
    Overwrite installed formulae

-s, --build-from-source
    Compile from source, ignore bottles

--HEAD
    Install development HEAD version

--ignore-dependencies
    Skip dependency installation

--only-dependencies
    Install only dependencies

--quiet
    Suppress non-critical output

--force-bottle
    Use bottles despite warnings

--overwrite
    Overwrite files from other installs

DESCRIPTION

Homebrew, often called brew, is a popular package manager originally for macOS but fully supported on Linux via Linuxbrew. The brew install command downloads, compiles (if needed), and installs software packages known as formulae from the Homebrew repository. It handles dependencies automatically, supports binary bottles for faster installs, and places executables in $HOMEBREW_PREFIX/bin (typically ~/.linuxbrew/bin or /home/linuxbrew/.linuxbrew/bin).

On Linux, it excels for installing tools not in distro repos, like latest versions of ffmpeg, wget, or development libraries. Bottles are pre-compiled binaries optimized for common Linux distros (glibc 2.19+). If no bottle exists, it builds from source using system compilers.

Usage simplifies workflows: brew install htop fetches, verifies, installs, and links htop. Post-install, add $HOMEBREW_PREFIX/bin to PATH for global access. It also supports casks for GUI apps on Linux where applicable.

CAVEATS

Requires glibc >= 2.19 and x86_64 CPU. Not all formulae have Linux bottles; source builds need build tools like gcc. Prefix binaries in PATH. Multi-user installs need /home/linuxbrew/.linuxbrew ownership.

QUICK START

Install Homebrew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Example: brew install git or brew install --HEAD neovim

POST-INSTALL

Run brew doctor to check setup. Use brew link if needed. Update with brew update && brew upgrade.

HISTORY

Created by Max Howell in 2009 for macOS. Linux support via Linuxbrew (2013, by Michka Popov), merged into Homebrew in 2018. Now official with growing Linux formula support.

SEE ALSO

apt(8), dnf(8), pacman(8), yum(8)

Copied to clipboard