Emerge

From Gentoo Linux Wiki

Jump to: navigation, search

Contents

[edit] Overview

Emerge is the primary portage tool for package management. It allows you to install and remove packages as well as perform various other related tasks.

[edit] Basics

emerge -uavDN world

Simply doing emerge world will most likely not have the desired result when attempting to upgrade your system. Often a better way to do this is by using emerge -uavDN world. Here's and explanation of the extra switches and what they do:

  • u: The update switch is often included for clarity, but is the default action when using the "world" or "system" package specifications.
  • a: (ask) This is highly recommended on any emerge. It will tell you what it's planning to do before it does it. This gives you a chance to scan the list to make sure nothing is terribly wrong.
  • v: (verbose)[optional] This gives you more verbose output. It is technically optional, but it is often helpful.
  • D: (deep)The world package is not a list of every single package on your system. Only the ones you have emerged. For example, if you do emerge gnome there will be many dependencies installed on you system as well as gnome-base/gnome; however, only gnome-base/gnome will be recorded in the world files. Using D scans through the dependencies for updates too.
  • N: (newuse)[optional] This is the most optional of them all. Essentially what it does is check for any changes in the USE flags. This would normally be the case if you changed something in /etc/make.conf or maybe /etc/portage/package.use. For example, if you added USE="java" in /etc/make.conf and mozilla-firefox was originally emerged with the default setting (-java), then adding N would cause this command to re-emerge mozilla-firefox with the new USE variables.
  • e: [highly optional] This option pretends that nothing is installed, it is only useful when upgrading a part of your toolchain. The emerge -e command is perfectly equivalent to a stage 1 installation. Use it only if you know what you do. Check out this post for more information.

[edit] Checking for broken packages

Did you break anything during the upgrade? Use "revdep-rebuild" to find out.

revdep-rebuild

This is highly recommended after any package update if said package has dependencies.

[edit] Using Genlop

Genlop is a tool that parses log files. Genlop can be used to find out how long your emerge world will take. A basic command to do this would be emerge -p world | genlop -p but you can add any number of portage switches from above to your emerge command.

[edit] Special Cases

There may be several cases where the above does not upgrade what you want. The main case is when you are using CVS packages like Enlightenment. Note that this should be the exception, not the rule. You should avoid using CVS unless you are willing to accept the consequences that they may bring.

The reason this does not upgrade CVS packages is because the packages do not change versions (they stay at 9999 usually). Also this means that the dependencies cannot be checked in the proper way either. This is probably just as well anyways. CVS packages should be handled separately. Something like emerge -av cvs_packages should do the trick.

[edit] Subpages

[edit] See also

Personal tools