Skip to main content
Uninstalls one or more formulas from your system, removing both the symlinks and the installation metadata.

Usage

zb uninstall <FORMULAS>... [OPTIONS]

Arguments

FORMULAS
string[]
One or more formula names to uninstall. Required unless --all is used.Examples: jq, wget, git

Options

--all
boolean
Uninstall all currently installed formulas. When this flag is used, you don’t need to specify individual formula names.Warning: This will remove all packages installed with zerobrew.
--root
path
Environment: ZEROBREW_ROOTOverride the root directory for zerobrew’s content-addressable store.
--prefix
path
Environment: ZEROBREW_PREFIXOverride the prefix directory where packages are linked.
--concurrency
number
Default: 20Number of concurrent operations to perform.
--auto-init
boolean
Alias: --yesEnvironment: ZEROBREW_AUTO_INITAutomatically initialize zerobrew if not already set up.

Examples

Uninstall a single package

zb uninstall jq
==> Uninstalling jq...

Uninstall multiple packages

zb uninstall wget git
==> Uninstalling wget, git...
    ○ wget... ✓
    ○ git... ✓

Uninstall all packages

zb uninstall --all
==> Uninstalling jq, wget, git, openssl@3, pcre2...
    ○ jq... ✓
    ○ wget... ✓
    ○ git... ✓
    ○ openssl@3... ✓
    ○ pcre2... ✓
If no packages are installed:
No formulas installed.

Behavior

When you uninstall a formula, zerobrew:
  1. Removes symlinks from the prefix directory (e.g., /usr/local/bin)
  2. Removes installation metadata from the local database
  3. Keeps store entries - the actual files remain in the content-addressable store
To clean up unused store entries, use zb gc after uninstalling packages.

Error Handling

Formula not installed

If you try to uninstall a package that isn’t installed:
Error: Formula 'nonexistent' is not installed

Partial failures

When uninstalling multiple packages, zerobrew will attempt to uninstall all of them even if some fail:
zb uninstall jq wget nonexistent
==> Uninstalling jq, wget, nonexistent...
    ○ jq... ✓
    ○ wget... ✓
    ○ nonexistent... ✗
Error: Failed to uninstall nonexistent: Formula 'nonexistent' is not installed

Comparison with Homebrew

FeaturezerobrewHomebrew
Uninstall commandzb uninstallbrew uninstall
Uninstall allzb uninstall --allbrew uninstall $(brew list)
Remove dependenciesManual with zb gcbrew autoremove
Store cleanupzb gcAutomatic
  • zb install - Install packages
  • zb list - List installed packages
  • zb gc - Clean up unused store entries
  • zb reset - Uninstall everything and reset zerobrew

Build docs developers (and LLMs) love