Cross-manager operationsยถ

The same package name often shows up across multiple managers: a tool packaged simultaneously for Homebrew, Cargo, npm, and pipx, or installed by mistake through more than one route on the same machine. mpm treats this as a first-class concern: find the best source for a new install, let it pick that source for you, and surface installations that already overlap.

Find the best sourceยถ

Searching across every supported manager at once tells you where the latest version actually lives:

$ mpm search broot --exact
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ Package ID โ”‚ Name โ”‚ Manager โ”‚ Latest version โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ broot      โ”‚      โ”‚ brew    โ”‚ 1.16.2         โ”‚
โ”‚ broot      โ”‚      โ”‚ cargo   โ”‚ 0.13.6         โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
2 packages total (brew: 1, pip: 1, cask: 0, gem: 0, mas: 0, npm: 0).

Then choose your preferred package manager to install it:

$ mpm --brew install broot
(...)
๐Ÿบ  /usr/local/Cellar/broot/1.16.2: 8 files, 3.5MB
โœ“ broot installed with brew
Installed 1/1 packages

This pattern catches the common โ€œI want the freshest versionโ€ decision without having to query each manager by hand.

Install with the first available managerยถ

Rather than searching and picking a source by hand, let mpm install a package with the first manager (by priority) that has it, implementing XKCD #1654 - Universal Install Script:

XKCD #1654 - Universal Install Script

$ mpm --xkcd install markdown
Installation priority: pip > brew > npm > dnf > apt > steamcmd
warning: pip does not implement search operation.
markdown existence unconfirmed, try to directly install it...
Install markdown package with pip...
(...)

Audit existing installationsยถ

When the same package is already installed through more than one manager, list every duplicate with:

$ mpm list --duplicates
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ Package ID โ”‚ Name โ”‚ Manager โ”‚ Installed version โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ blah       โ”‚      โ”‚ cargo   โ”‚ 0.0.0             โ”‚
โ”‚ blah       โ”‚      โ”‚ gem     โ”‚ 0.0.2             โ”‚
โ”‚ blah       โ”‚      โ”‚ npm     โ”‚ 5.2.1             โ”‚
โ”‚ coverage   โ”‚      โ”‚ pip     โ”‚ 6.4.1             โ”‚
โ”‚ coverage   โ”‚      โ”‚ pipx    โ”‚ 6.4.1             โ”‚
โ”‚ six        โ”‚      โ”‚ brew    โ”‚ 1.16.0_2          โ”‚
โ”‚ six        โ”‚      โ”‚ pip     โ”‚ 1.16.0            โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
7 packages total (pip: 2, brew: 1, cargo: 1, gem: 1, npm: 1, pipx: 1, cask: 0).

Removing every copy at once is a single command:

$ mpm remove blah
(...)
Successfully uninstalled blah-0.0.0
โœ“ blah removed from cargo
(...)
Successfully uninstalled blah-0.0.2
โœ“ blah removed from gem
(...)
Successfully uninstalled blah-5.2.1
โœ“ blah removed from npm
Removed 3/3 packages

Or target a specific duplicate by routing through one manager:

$ mpm --pip uninstall six
(...)

Todo

Add an --installed boolean flag to search to reduce the searched packages to those already installed. (installed itself now accepts a QUERY argument to filter its own listing.)

See alsoยถ

  • Snapshot and export โ€” snapshot the resolved installation set after deduplication.

  • Configuration โ€” pin a preferred manager order so duplicates resolve consistently across runs.