Gentoo emerge

Portage’s emerge, Gentoo’s source-based package manager.

Documentation:

See other command equivalences at: https://wiki.archlinux.org/title/Pacman/Rosetta

The outdated listing and the whole-system upgrade operate against the @world set. The progress spinner and ANSI coloring are disabled on every call, leaving output the regexes can parse.

Note

Two operations lean on companion Portage tools rather than emerge itself: installed reads the package list through qlist and cleanup trims distfiles through eclean. Neither is resolved through cli_path the way the reference emerge binary is; both are expected on the PATH.

Warning

cleanup forces a full @world upgrade before running --depclean: Portage refuses to remove packages until every dependency is resolved, so depcleaning a partially-upgraded system could drop still-needed packages.

Platforms

  • 🅱️ BSD

  • 🐧 Linux

  • ⨂ Unix

Operations

Operation

Supported

installed

outdated

search

install

upgrade

upgrade_all

remove

sync

cleanup

Ecosystem

  • Accepted purl types: pkg:ebuild, pkg:emerge

Usage

$ mpm --emerge installed
$ mpm --emerge search "query"
$ mpm --emerge upgrade --all
$ mpm install pkg:emerge/hello
$ mpm --dry-run --emerge upgrade --all

Every example above accepts --dry-run, which simulates the underlying manager calls without touching the system: the safe way to watch what mpm would do before trusting it.

Deselect the manager for a single run with --no-emerge, disable it from your configuration, or tune its invocation attributes with per-manager overrides.

Command line

  • CLI names, in lookup order: emerge

  • Arguments forced before each call: --quiet --color n --nospinner

The version is probed by running:

$ emerge --version
Portage 3.0.30 (python 3.9.9-final-0, gcc-11.2.1, 5.15.32-gentoo-r1 x86_64)

and extracted with:

r"Portage\s+(?P<version>\S+)"

Privilege escalation

System-wide manager: mpm wraps its privileged operations in sudo out of the box. Instead of letting the tool prompt mid-run, mpm primes the credential cache up-front, with a single branded password prompt at most. Turn escalation off for rootless setups with --no-sudo or the per-manager sudo override.

See privilege escalation for the full policy.

Cooldown

State of Gentoo emerge’s release-age gating, from the cooldown support table:

  • Status: ❌ None

With --cooldown set, mpm skips this manager’s install and upgrade operations rather than run them unguarded (fail-closed); --allow-unsupported-managers opts back in.

Reference traces

Raw native outputs captured in the manager source: the reference mpm’s parsers were written against. If you know Gentoo emerge well and a transcript below looks wrong, or a newer release changed its output format, report it.

$ qlist --installed --verbose --nocolor
acct-group/audio-0-r1
acct-group/cron-0
app-admin/hddtemp-0.3_beta15-r29
app-admin/perl-cleaner-2.30
app-admin/system-config-printer-1.5.16-r1
app-arch/p7zip-16.02-r8
$ emerge --update --deep --pretend --columns --color n --nospinner @world
[blocks  B     ] app-text/dos2unix
[ebuild   N    ] app-games/qstat   [25c]
[ebuild    R   ] sys-apps/sed      [2.4.7-r6]
[ebuild       U] net-fs/samba      [2.2.8_pre1]      [2.2.7a]
[ebuild       U] sys-devel/distcc  [2.16]            [2.13-r1] USE=ip6* -gtk
[ebuild r     U] dev-libs/icu      [50.1.1:0/50.1.1] [50.1-r2:0/50.1]
[ebuild r  R   ] dev-libs/libxml2  [2.9.0-r1:2]       USE=icu