LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

brew-autoremove

Remove orphaned Homebrew dependencies

TLDR

Remove unused dependencies
$ brew autoremove
copy
Preview what would be removed
$ brew autoremove --dry-run
copy

SYNOPSIS

brew autoremove [options]

DESCRIPTION

brew autoremove uninstalls formulae that were only installed as dependencies and are no longer needed by any installed formula. It cleans up orphaned dependencies left behind after uninstalling packages.

PARAMETERS

--dry-run, -n

List what would be removed without removing

HOW IT WORKS

When you install a package like git, dependencies (gettext, pcre2) are installed automatically. When you uninstall git, those dependencies remain. Running brew autoremove removes these orphaned dependencies.

EXAMPLE WORKFLOW

$ brew uninstall git          # Remove package
brew autoremove             # Clean up dependencies
brew cleanup                # Remove cached downloads
copy

PREVENTING REMOVAL

To prevent a formula from being removed by autoremove, reinstall it explicitly to mark it as "installed on request":

$ brew install formula
copy
This changes the formula's status from dependency to explicitly installed.

RELATED COMMANDS

brew leaves

Show top-level packages (not dependencies)
brew deps --installed
Show dependency tree
brew cleanup
Remove cached downloads and old versions

CAVEATS

Only removes formulae installed as dependencies, not those explicitly installed. Safe to run regularly after uninstalling packages. Does not remove casks.

SEE ALSO

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid