LinuxCommandLibrary

brew-rm

Uninstall Homebrew packages

TLDR

View documentation for the original command

$ tldr brew uninstall
copy

SYNOPSIS

brew rm [options] <formula|cask> ...

PARAMETERS

-f, --force
    Remove all versions; newest only if unlinked otherwise.

--ignore-dependencies
    Ignore dependent formulae; proceed with removal.

--include-test-formulae
    Remove test formulae alongside main ones.

-n, --dry-run
    Simulate removal; show what would be deleted.

-v, --verbose
    Print detailed output during process.

-d, --debug
    Enable debug logging for troubleshooting.

--cask
    Treat arguments as casks, not formulae.

-q, --quiet
    Suppress non-error output.

DESCRIPTION

brew rm (alias for brew uninstall or brew remove) removes installed formulae, casks, or kegs from Homebrew on macOS or Linux. It unlinks symlinks in $(brew --prefix), deletes cellars, and cleans up caches. By default, it prompts before removing the newest version unless already unlinked, preserving older versions if present.

Use --force (-f) to remove all versions unconditionally. It handles dependencies cautiously, failing if other packages depend on the target unless --ignore-dependencies is used. For casks, add --cask; it removes app bundles from /Applications and related files.

On Linux (Linuxbrew/Homebrew), targets $HOMEBREW_PREFIX (often ~/.linuxbrew). Verbose output via -v; dry-run with -n. Ideal for cleaning up unused software, but review dependencies first to avoid breakage.

Integrates with brew autoremove for orphans. Post-removal, brew cleanup frees disk space.

CAVEATS

Fails on pinned formulae; unpin first with brew unpin. Does not remove from taps; use brew untap. On Linux, ensure HOMEBREW_PREFIX access. Back up before --force; no undo.

EXAMPLES

brew rm wget
brew rm --cask firefox --force
brew rm $(brew leaves) (orphans)

CAVEAT ON LINUX

Uses /home/linuxbrew/.linuxbrew by default; set HOMEBREW_PREFIX env var for custom paths.

HISTORY

Homebrew launched 2009 by Max Howell; brew rm added early as uninstall alias. Evolved with cask support (2014). Linuxbrew fork 2013 by Michka Popov; merged back 2020 for native Linux. Current version adapts to glibc/musl.

SEE ALSO

brew install(1), brew list(1), brew cleanup(1), brew autoremove(1)

Copied to clipboard