Homebrew uninstall removes a formula or cask from the active Homebrew prefix when a command-line tool, library, desktop app, or font no longer belongs on the machine. The package can leave behind dependents, cache files, or cask support files, so the removal needs a narrow target and a separate verification check.

Formulae and casks use the same brew uninstall command, but the package type matters when a token could refer to more than one item. Use --formula for command-line formulae and --cask for casks so Homebrew does not resolve the name differently than intended.

Uninstalling a package does not mean every related file disappears. Shared dependencies can stay installed, brew cleanup handles old downloads and stale versions, and brew uninstall --zap is only for casks when associated support files should also be removed.

Steps to uninstall a Homebrew package:

  1. Check the installed package and package type.
    $ brew list --formula --versions hello
    hello 2.12.3

    The uninstall command removes the target from the active Homebrew prefix. Close apps or stop services that use it first, and avoid --ignore-dependencies unless broken dependents are already accepted. Use brew list --cask --versions visual-studio-code for a cask token.

  2. Uninstall the package with the type made explicit.
    $ brew uninstall --formula hello
    Uninstalling /home/linuxbrew/.linuxbrew/Cellar/hello/2.12.3... (58 files, 809.0KB)

    Use --cask instead of --formula for casks. Add --zap only when a cask's associated support files should also be removed; Homebrew warns that zap can remove files shared between applications.

  3. Confirm that Homebrew no longer lists the package.
    $ brew list --formula --versions hello

    No output means Homebrew no longer has that formula installed. Use the matching --cask form for casks.
    Related: How to list installed Homebrew packages

  4. Confirm that the expected command or app artifact is gone.
    $ command -v hello

    No output means the shell cannot find the hello command in PATH. For casks, check the app bundle, font, plugin, or artifact path shown by brew info --cask before uninstalling.
    Related: How to check Homebrew package information

  5. Preview unused dependency formulae left after removal.
    $ brew autoremove --dry-run

    No output means Homebrew found no dependency-only formulae to autoremove. Review any listed formulae before running brew autoremove, because that command uninstalls packages from the active prefix.
    Related: How to remove unused Homebrew dependencies
    Related: How to clean Homebrew cache and old versions