emerge

From RaySoft

emerge is the definitive command-line interface to the Portage system. It is primarily used for installing packages, and emerge can automatically handle any dependencies that the desired package has. emerge can also update the Portage tree, making new and updated packages available. emerge gracefully handles updating installed packages to newer releases as well. It handles both source and binary packages, and it can be used to create binary packages for distribution.[1]

Documentation

Syntax

emerge [PARAMETER ...] [ACTION] [EBUILD [...]|@world]
emerge --sync

Subcommands & Parameters

Global parameters
The following parameters can be used with the subcommands above:
-D [DEPTH], --deep [DEPTH]
This flag forces emerge to consider the entire dependency tree of packages, instead of checking only the immediate dependencies of the packages. As an example, this catches updates in libraries that are not directly listed in the dependencies of a package.
-f, --fetchonly
Instead of doing any package building, just perform fetches for all packages.
-N, --newuse
Tells emerge to include installed packages where USE flags have changed since compilation.
-p, --pretend
Instead of actually performing the merge, simply display what would have been installed if --pretend weren't used. Using --pretend is strongly recommended before installing an unfamiliar package.
-u, --update
Updates packages to the best version available, which may not always be the highest version number due to masking for testing and development. Package atoms specified on the command line are greedy, meaning that unspecific atoms may match multiple versions of slotted packages.
-v, --verbose
Tell emerge to run in verbose mode. Currently this flag causes emerge to print out GNU info errors, if any, and to show the USE flags that will be used for each package when pretending.
--with-bdeps y|n
In dependency calculations, pull in build time dependencies that are not strictly required. This defaults to n for installation actions, meaning they will not be installed, and y for the --depclean action, meaning they will not be removed.
-c, --depclean
Cleans the system by removing packages that are not associated with explicitly merged packages. Depclean works by creating the full dependency tree from the @world set, then comparing it to installed packages. Packages installed, but not part of the dependency tree, will be uninstalled by depclean.
-P, --prune
Removes all but the highest installed version of a package from your system. Use --prune together with --verbose to show reverse dependencies or with --nodeps to ignore all dependencies.

Examples

Update the whole system

Edit the files /etc/portage/make.conf & /etc/portage/package.use if necessary.

emaint --auto sync
emerge --update --deep --newuse --with-bdeps='y' --pretend --verbose '@world'
emerge --update --deep --newuse --with-bdeps='y' '@world'
emerge --depclean

References

  1. man 1 'emerge'