.TH "EMERGE" "1" "Jun 2007" "Portage 2.1.3" "Portage" .SH "NAME" emerge \- Command\-line interface to the Portage system .SH "SYNOPSIS" .TP .BR emerge [\fIoptions\fR] [\fIaction\fR] [\fIebuild\fR | \fItbz2file\fR | \fIfile\fR | \fI@set\fR | \fIatom\fR] ... .TP .BR emerge \fB\-\-sync\fR | \fB\-\-version\fR .TP .BR emerge \fB\-\-info\fR [\fIatom\fR] .TP .BR emerge \fB\-\-search\fR \fIsomestring\fR .TP .BR emerge \fB\-\-help\fR [\fBsystem\fR | \fBworld\fR | \fB\-\-sync\fR] .SH "DESCRIPTION" \fBemerge\fR is the definitive command\-line interface to the Portage system. It is primarily used for installing packages, and \fBemerge\fR can automatically handle any dependencies that the desired package has. \fBemerge\fR can also update the \fBportage tree\fR, making new and updated packages available. \fBemerge\fR 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. .SH "EBUILDS, TBZ2S, SETS AND ATOMS" \fBemerge\fR primarily installs packages. You can specify packages to install in one of four main ways: an \fIebuild\fR, a \fItbz2file\fR, a \fIset\fR, or an \fIatom\fR. .LP .TP .BR ebuild An \fIebuild\fR must be, at a minimum, a valid Portage package directory name without a version or category, such as \fBportage\fR or \fBpython\fR. Both categories and version numbers may be used in addition, such as \fBsys\-apps/portage\fR or \fB=python\-2.2.1\-r2\fR. \fBemerge\fR ignores a trailing slash so that filename completion can be used. The \fIebuild\fR may also be an actual filename, such as \fB/usr/portage/app\-admin/python/python\-2.2.1\-r2.ebuild\fR. \fBWARNING:\fR The implementation of \fBemerge /path/to/ebuild\fR is broken and so this syntax shouldn't be used. .TP .BR tbz2file A \fItbz2file\fR must be a valid .tbz2 created with \fBebuild \-.ebuild package\fR or \fBemerge \-\-buildpkg [category/]\fR or \fBquickpkg /var/db/pkg//\fR. .TP .BR file A \fIfile\fR must be a file or directory that has been installed by one or more packages. For directories that are owned by multiple packages, all owning packages to be selected. See the portageq(1) owners command if you would like to query the owners of one or more files or directories. .TP .BR set A \fIset\fR is a convenient shorthand for a large group of packages. Two sets are currently always available: \fBsystem\fR and \fBworld\fR. \fBsystem\fR refers to a set of packages deemed necessary for your system to run properly. \fBworld\fR contains all the packages listed in \fB/var/lib/portage/world\fR. [See \fBFILES\fR below for more information.] Other sets can exist depending on the current configuration. Note that a \fIset\fR is generally used in conjunction with \fB\-\-update\fR. When used as arguments to \fBemerge\fR sets have to be prefixed with \fB@\fR to be recognized. .TP .BR atom An \fIatom\fR describes bounds on a package that you wish to install. \fISee portage(5) for the details on atom syntax.\fR For example, \fB>=dev\-lang/python\-2.2.1\-r2\fR matches the latest available version of Python greater than or equal to 2.2.1\-r2. Similarly, \fB" Enable or disable color output. This option will override \fINOCOLOR\fR (see \fBmake.conf\fR(5)) and may also be used to force color output when stdout is not a tty (by default, color is disabled unless stdout is a tty). .TP .BR "\-\-columns" Used alongside \fB\-\-pretend\fR to cause the package name, new version, and old version to be displayed in an aligned format for easy cut\-n\-paste. .TP .BR "\-\-complete\-graph" This causes \fBemerge\fR to consider the deep dependencies of all packages from the system and world sets. With this option enabled, \fBemerge\fR will bail out if it determines that the given operation will break any dependencies of the packages that have been added to the graph. Like the \fB\-\-deep\fR option, the \fB\-\-complete\-graph\fR option will significantly increase the time taken for dependency calculations. Note that, unlike the \fB\-\-deep\fR option, the \fB\-\-complete\-graph\fR option does not cause any more packages to be updated than would have otherwise been updated with the option disabled. .TP .BR \-\-config\-root=DIR Set the \fBPORTAGE_CONFIGROOT\fR environment variable. .TP .BR "\-\-debug " (\fB\-d\fR) Tells emerge to run the emerge command in \fB\-\-debug\fR mode. In this mode the bash build environment will run with the \-x option, causing it to output verbose debugging information to stdout. This also enables a plethora of other output (mostly dependency resolution messages). .TP .BR "\-\-deep " (\fB\-D\fR) This flag forces \fBemerge\fR 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. Also see \fB\-\-with\-bdeps\fR for behavior with respect to build time dependencies that are not strictly required. .TP .BR "\-\-emptytree " (\fB\-e\fR) Reinstalls all world packages and their dependencies to the current USE specifications while differing from the installed set of packages as little as possible. You should run with \fB\-\-pretend\fR first to make sure the result is what you expect. .TP .BR "\-\-fetchonly " (\fB\-f\fR) Instead of doing any package building, just perform fetches for all packages (fetch things from SRC_URI based upon USE setting). .TP .BR "\-\-fetch\-all\-uri " (\fB\-F\fR) Instead of doing any package building, just perform fetches for all packages (fetch everything in SRC_URI regardless of USE setting). .TP .BR "\-\-getbinpkg " (\fB\-g\fR) Using the server and location defined in \fIPORTAGE_BINHOST\fR (see \fBmake.conf\fR(5)), portage will download the information from each binary package found and it will use that information to help build the dependency list. This option implies \fB\-k\fR. (Use \fB\-gK\fR for binary\-only merging.) .TP .BR "\-\-getbinpkgonly " (\fB\-G\fR) This option is identical to \fB\-g\fR, as above, except it will not use ANY information from the local machine. All binaries will be downloaded from the remote server without consulting packages existing in the local packages directory. .TP .BR "\-\-ignore-default-opts" Causes \fIEMERGE_DEFAULT_OPTS\fR (see \fBmake.conf\fR(5)) to be ignored. .TP .BR "-j [JOBS], \-\-jobs[=JOBS]" Specifies the number of packages to build simultaneously. If this option is given without an argument, emerge will not limit the number of jobs that can run simultaneously. Also see the related \fB\-\-load\-average\fR option. .TP .BR "\-\-keep\-going" Continue as much as possible after an error. When an error occurs, dependencies are recalculated for remaining packages and any with unsatisfied dependencies are automatically dropped. Also see the related \fB\-\-skipfirst\fR option. .TP .BR \-\-load\-average=LOAD Specifies that no new builds should be started if there are other builds running and the load average is at least LOAD (a floating-point number). This option is recommended for use in combination with \fB\-\-jobs\fR in order to avoid excess load. See \fBmake\fR(1) for information about analogous options that should be configured via \fBMAKEOPTS\fR in \fBmake.conf\fR(5). .TP .BR "\-\-newuse " (\fB\-N\fR) Tells emerge to include installed packages where USE flags have changed since compilation. USE flag changes include: A USE flag was added to a package. A USE flag was removed from a package. A USE flag was turned on for a package. A USE flag was turned off for a package. USE flags may be toggled by your profile as well as your USE and package.use settings. .TP .BR "\-\-noconfmem" Causes portage to disregard merge records indicating that a config file inside of a \fBCONFIG_PROTECT\fR directory has been merged already. Portage will normally merge those files only once to prevent the user from dealing with the same config multiple times. This flag will cause the file to always be merged. .TP .BR "\-\-nodeps " (\fB\-O\fR) Merges specified packages without merging any dependencies. Note that the build may fail if the dependencies aren't satisfied. .TP .BR "\-\-noreplace " (\fB\-n\fR) Skips the packages specified on the command\-line that have already been installed. Without this option, any packages, ebuilds, or deps you specify on the command\-line \fBwill\fR cause Portage to remerge the package, even if it is already installed. Note that Portage will not remerge dependencies by default. .TP .BR "\-\-nospinner" Disables the spinner for the session. The spinner is active when the terminal device is determined to be a TTY. This flag disables it regardless. .TP .BR "\-\-oneshot " (\fB\-1\fR) Emerge as normal, but do not add the packages to the world file for later updating. .TP .BR "\-\-onlydeps " (\fB\-o\fR) Only merge (or pretend to merge) the dependencies of the packages specified, not the packages themselves. .TP .BR "\-\-pretend " (\fB\-p\fR) Instead of actually performing the merge, simply display what *would* have been installed if \fB\-\-pretend\fR weren't used. Using \fB\-\-pretend\fR is strongly recommended before installing an unfamiliar package. In the printout: .br .br \fIN\fR = new (not yet installed) .br \fIS\fR = new SLOT installation (side-by-side versions) .br \fIU\fR = updating (to another version) .br \fID\fR = downgrading (best version seems lower) .br \fIR\fR = replacing (remerging same version)) .br \fIF\fR = fetch restricted (must be manually downloaded) .br \fIf\fR = fetch restricted (already downloaded) .br \fIB\fR = blocked by an already installed package .TP .BR "\-\-quiet " (\fB\-q\fR) Results may vary, but the general outcome is a reduced or condensed output from portage's displays. .TP .BR "\-\-reinstall changed\-use" Tells emerge to include installed packages where USE flags have changed since installation. Unlike \fB\-\-newuse\fR, this option does not trigger reinstallation when flags that the user has not enabled are added or removed. .TP .BR "\-\-skipfirst" This option is only valid when used with \fB\-\-resume\fR. It removes the first package in the resume list. Dependencies are recalculated for remaining packages and any that have unsatisfied dependencies or are masked will be automatically dropped. Also see the related \fB\-\-keep\-going\fR option. .TP .BR "\-\-tree " (\fB\-t\fR) Shows the dependency tree for the given target by indenting dependencies. This is only really useful in combination with \fB\-\-emptytree\fR or \fB\-\-update\fR and \fB\-\-deep\fR. .TP .BR "\-\-usepkg " (\fB\-k\fR) Tells emerge to use binary packages (from $PKGDIR) if they are available, thus possibly avoiding some time\-consuming compiles. This option is useful for CD installs; you can export PKGDIR=/mnt/cdrom/packages and then use this option to have emerge "pull" binary packages from the CD in order to satisfy dependencies. .TP .BR "\-\-usepkgonly " (\fB\-K\fR) Tells emerge to only use binary packages (from $PKGDIR). All the binary packages must be available at the time of dependency calculation or emerge will simply abort. Portage does not use $PORTDIR when calculating dependency information so all masking information is ignored. .TP .BR "\-\-verbose " (\fB\-v\fR) 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. The following symbols are affixed to USE flags in order to indicate their status: .br .br \fI- prefix\fR = not enabled (either disabled or removed) .br \fI* suffix\fR = transition to or from the enabled state .br \fI% suffix\fR = newly added or removed .br \fI() circumfix\fR = forced, masked, or removed .TP .BR "\-\-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 \fB\-\-depclean\fR action, meaning they will not be removed. This setting can be added to \fBEMERGE_DEFAULT_OPTS\fR (see make.conf(5)) and later overridden via the command line. .SH "ENVIRONMENT OPTIONS" .TP \fBROOT\fR = \fI[path]\fR Use \fBROOT\fR to specify the target root filesystem to be used for merging packages or ebuilds. This variable can be set in \fBmake.conf\fR(5) when \fBPORTAGE_CONFIGROOT\fR has a value other than /. .br Defaults to /. .TP \fBPORTAGE_CONFIGROOT\fR = \fI[path]\fR Use \fBPORTAGE_CONFIGROOT\fR to specify the location for various portage configuration files (see \fBFILES\fR for a detailed list of configuration files). This variable can be set via the \fB\-\-config\-root\fR option. .br Defaults to /. .SH "OUTPUT" When utilizing \fBemerge\fR with the \fB\-\-pretend\fR and \fB\-\-verbose\fR flags, the output may be a little hard to understand at first. This section explains the abbreviations. .TP .B [blocks B ] app\-text/dos2unix (from pkg app\-text/hd2u\-0.8.0) Dos2unix is Blocking hd2u from being emerged. Blockers are defined when two packages will clobber each others files, or otherwise cause some form of breakage in your system. However, blockers usually do not need to be simultaneously emerged because they usually provide the same functionality. .TP .B [ebuild N ] app\-games/qstat\-25c Qstat is New to your system, and will be emerged for the first time. .TP .B [ebuild NS ] dev-libs/glib-2.4.7 You already have a version of glib installed, but a 'new' version in a different SLOT is available. .TP .B [ebuild R ] sys\-apps/sed\-4.0.5 Sed 4.0.5 has already been emerged, but if you run the command, then portage will Re\-emerge the specified package (sed in this case). .TP .B [ebuild F ] media\-video/realplayer\-8\-r6 The realplayer package requires that you Fetch the sources manually. When you attempt to emerge the package, if the sources are not found, then portage will halt and you will be provided with instructions on how to download the required files. .TP .B [ebuild f ] media\-video/realplayer\-8\-r6 The realplayer package's files are already downloaded. .TP .B [ebuild U ] net\-fs/samba\-2.2.8_pre1 [2.2.7a] Samba 2.2.7a has already been emerged and can be Updated to version 2.2.8_pre1. .TP .B [ebuild UD] media\-libs/libgd\-1.8.4 [2.0.11] Libgd 2.0.11 is already emerged, but if you run the command, then portage will Downgrade to version 1.8.4 for you. .br This may occur if a newer version of a package has been masked because it is broken or it creates a security risk on your system and a fix has not been released yet. .br Another reason this may occur is if a package you are trying to emerge requires an older version of a package in order to emerge successfully. In this case, libgd 2.x is incompatible with libgd 1.x. This means that packages that were created with libgd 1.x will not compile with 2.x and must downgrade libgd first before they can emerge. .TP .B [ebuild U ] sys\-devel/distcc\-2.16 [2.13\-r1] USE="ipv6* \-gtk \-qt%" Here we see that the make.conf variable \fBUSE\fR affects how this package is built. In this example, ipv6 optional support is enabled and both gtk and qt support are disabled. The asterisk following ipv6 indicates that ipv6 support was disabled the last time this packages was installed. The percent sign following qt indicates that the qt option has been added to the package since it was last installed. For information about all \fBUSE\fR symbols, see the \fB\-\-verbose\fR option documentation above. .br \fB*Note:\fR Flags that haven't changed since the last install are only displayed when you use the \fB\-\-pretend\fR and \fB\-\-verbose\fR options. Using the \fB\-\-quiet\fR option will prevent all information from being displayed. .SH "NOTES" You should almost always precede any package install or update attempt with a \fB\-\-pretend\fR install or update. This lets you see how much will be done, and shows you any blocking packages that you will have to rectify. This goes doubly so for the \fBsystem\fR and \fBworld\fR sets, which can update a large number of packages if the portage tree has been particularly active. .LP You also want to typically use \fB\-\-update\fR, which ignores packages that are already fully updated but updates those that are not. .LP When you install a package with uninstalled dependencies and do not explicitly state those dependencies in the list of parameters, they will not be added to the world file. If you want them to be detected for world updates, make sure to explicitly list them as parameters to \fBemerge\fR. .LP \fBUSE variables\fR may be specified on the command line to override those specified in the default locations, letting you avoid using some dependencies you may not want to have. \fBUSE flags specified on the command line are NOT remembered\fR. For example, \fBenv USE="\-X \-gnome" emerge mc\fR will emerge mc with those USE settings (on Bourne-compatible shells you may omit the \fBenv\fR part). If you want those USE settings to be more permanent, you can put them in /etc/portage/package.use instead. .LP If \fBemerge \-\-update system\fR or \fBemerge \-\-update world\fR fails with an error message, it may be that an ebuild uses some newer feature not present in this version of \fBemerge\fR. You can use \fBemerge \-\-update portage\fR to upgrade to the lastest version, which should support any necessary new features. .SH "MASKED PACKAGES" \fINOTE: Please use caution when using development packages. Problems and bugs resulting from misusing masked packages drains Gentoo developer time. Please be sure you are capable of handling any problems that may ensue.\fR .LP Masks in \fBportage\fR have many uses: they allow a testing period where the packages can be used in live machines; they prevent the use of a package when it will fail; and they mask existing packages that are broken or could pose a security risk. Read below to find out how to unmask in various cases. Also note that if you give \fBemerge\fR an ebuild, then all forms of masking will be ignored and \fBemerge\fR will attempt to emerge the package. .TP .BR package.mask The \fBpackage.mask\fR file primarily blocks the use of packages that cause problems or are known to have issues on different systems. It resides in \fI/usr/portage/profiles\fR. .TP .BR CHOST Use the \fBACCEPT_CHOSTS\fR variable in \fBmake.conf\fR(5) to control \fBCHOST\fR acceptance for binary packages. .TP .BR EAPI The \fBEAPI\fR variable in an \fBebuild\fR(5) file is used to mask packages that are not supported by the current version of portage. Packages masked by \fBEAPI\fR can only be installed after portage has been upgraded. .TP .BR KEYWORDS The \fBKEYWORDS\fR variable in an \fBebuild\fR file is also used for masking a package still in testing. There are architecture\-specific keywords for each package that let \fBportage\fR know which systems are compatible with the package. Packages which compile on an architecture, but have not been proven to be "stable", are masked with a tilde (\fB~\fR) in front of the architecture name. \fBemerge\fR examines the \fBACCEPT_KEYWORDS\fR environment variable to allow or disallow the emerging of a package masked by \fBKEYWORDS\fR. To inform \fBemerge\fR that it should build these 'testing' versions of packages, you should update your \fI/etc/portage/package.keywords\fR file to list the packages you want the \'testing\' version. See \fBportage\fR(5) for more information. .SH "CONFIGURATION FILES" Portage has a special feature called "config file protection". The purpose of this feature is to prevent new package installs from clobbering existing configuration files. By default, config file protection is turned on for /etc and the KDE configuration dirs; more may be added in the future. .LP When Portage installs a file into a protected directory tree like /etc, any existing files will not be overwritten. If a file of the same name already exists, Portage will change the name of the to\-be\-installed file from 'foo' to \'._cfg0000_foo\'. If \'._cfg0000_foo\' already exists, this name becomes \'._cfg0001_foo\', etc. In this way, existing files are not overwritten, allowing the administrator to manually merge the new config files and avoid any unexpected changes. .LP In addition to protecting overwritten files, Portage will not delete any files from a protected directory when a package is unmerged. While this may be a little bit untidy, it does prevent potentially valuable config files from being deleted, which is of paramount importance. .LP Protected directories are set using the \fICONFIG_PROTECT\fR variable, normally defined in /etc/make.globals. Directory exceptions to the CONFIG_PROTECTed directories can be specified using the \fICONFIG_PROTECT_MASK\fR variable. To find files that need to be updated in /etc, type \fBfind /etc \-iname \'._cfg????_*\'\fR. .LP You can disable this feature by setting \fICONFIG_PROTECT="\-*"\fR in /etc/make.conf. Then, Portage will mercilessly auto\-update your config files. Alternatively, you can leave Config File Protection on but tell Portage that it can overwrite files in certain specific /etc subdirectories. For example, if you wanted Portage to automatically update your rc scripts and your wget configuration, but didn't want any other changes made without your explicit approval, you'd add this to /etc/make.conf: .LP .I CONFIG_PROTECT_MASK="/etc/wget /etc/rc.d" .LP Tools such as dispatch\-conf, cfg\-update, and etc\-update are also available to aid in the merging of these files. They provide interactive merging and can auto\-merge trivial changes. .SH "REPORTING BUGS" Please report any bugs you encounter through our website: .LP \fBhttp://bugs.gentoo.org/\fR .LP Please include the output of \fBemerge \-\-info\fR when you submit your bug report. .SH "AUTHORS" .nf Daniel Robbins Geert Bevin Achim Gottinger Nicholas Jones Phil Bordelon Mike Frysinger Marius Mauch .fi .SH "FILES" Here is a common list of files you will probably be interested in. For a complete listing, please refer to the \fBportage\fR(5) man page. .TP .B /var/lib/portage/world Contains a list of all user\-specified packages. You can safely edit this file, adding packages that you want to be considered in \fBworld\fR set updates and removing those that you do not want to be considered. .TP .B /etc/make.conf Contains variables for the build process, overriding those in \fBmake.globals\fR. .TP .B /etc/portage/color.map Contains variables customizing colors. .TP .B /etc/dispatch\-conf.conf Contains settings to handle automatic updates/backups of configuration files. .TP .B /etc/make.profile/make.defaults Contains profile\-specific variables for the build process. \fBDo not edit this file\fR. .TP .B /etc/make.profile/use.defaults Contains a list of packages which, if installed, cause the respective USE flag to be enabled by default. \fBDo not edit this file\fR. .TP .B /usr/portage/profiles/use.desc Contains the master list of USE flags with descriptions of their functions. \fBDo not edit this file\fR. .TP .B /etc/make.profile/virtuals Contains a list of default packages used to resolve virtual dependencies. \fBDo not edit this file\fR. .TP .B /etc/make.profile/packages Contains a list of packages used for the base system. The \fBsystem\fR and \fBworld\fR sets consult this file. \fBDo not edit this file\fR. .TP .B /etc/make.globals Contains the default variables for the build process. \fBDo not edit this file\fR. .SH "SEE ALSO" .BR "emerge \-\-help", .BR quickpkg (1), .BR ebuild (1), .BR ebuild (5), .BR make.conf (5), .BR color.map (5), .BR portage (5) .LP A number of helper applications reside in \fI/usr/lib/portage/bin\fR. .LP The \fBapp\-portage/gentoolkit\fR package contains useful scripts such as \fBequery\fR (a package query tool).