emerge
Install, update, and manage software packages
TLDR
Synchronize all packages
Update all packages, including dependencies
Resume a failed update, skipping the failing package
Install a new package, with confirmation
Remove a package and its dependencies with confirmation
Remove orphaned packages (installed as dependencies but no longer required by any package)
Search the package database for a keyword
SYNOPSIS
emerge [options] [action] [ebuild | tbz2file | @set | atom ...]
PARAMETERS
--ask, -a
Ask for confirmation before performing actions
--autounmask, -u
Attempt to resolve masked or broken dependencies
--backtrack=NUM
Set maximum backtracking steps for dependency resolution
--changed-use, -U
Rebuild packages with changed USE flags
--deep, -D
Update deep dependencies
--newuse, -N
Rebuild packages with new USE flags
--noreplace
Skip packages replaced by newer versions
--oneshot, -1
Install without adding to world file
--onlydeps
Install dependencies only
--pretend, -p
Display actions without executing
--quiet-build, -q
Reduce build output verbosity
--update, -u
Update packages to latest version
--verbose, -v
Increase verbosity
DESCRIPTION
Emerge is the command-line interface to Portage, Gentoo Linux's source-based package management system. It manages the installation, updating, removal, and querying of software packages, compiling them from source ebuilds for optimal performance and customization.
Key features include dependency resolution, USE flag configuration for enabling/disabling features, support for package sets (@world, @system), binary packages, and overlays for third-party ebuilds. Users specify packages via atoms like sys-apps/portage-3.0.54 or app-editors/vim.
Common workflows: emerge app-misc/screen installs a package; emerge -uDN @world updates the entire system with new USE flags and deep dependency checks; emerge -C pkg removes a package. Emerge respects /etc/portage/make.conf for global settings and supports pretend mode (--pretend) for dry runs.
It's powerful for advanced users but requires understanding of Gentoo's concepts like slots, masks, and keywords for stability.
CAVEATS
Requires root privileges for most actions; compilation can be resource-intensive and slow; incorrect USE flags or config may lead to breakage; always use --pretend first for complex updates.
ATOM SYNTAX
Format: [category/]package[-version][:slot][ (op ver) ]. Examples: sys-apps/portage, app-editors/vim:0.
PACKAGE SETS
@world: user-installed set; @system: core system packages; @preserved-rebuild: packages needing rebuild due to library changes.
HISTORY
Developed by Daniel Robbins for Gentoo Linux around 1999-2000 as part of the initial Portage system. Evolved significantly with Gentoo's growth, adding features like binary packages (2006), parallel emerge (2008), and modern dependency solvers. Remains core to Gentoo and derivatives like Funtoo.


