Portage

From XPUB & Lens-Based wiki

Portage is Gentoo's package manager. It allows you to easily install free software packages, from source, and helps to manage dependencies between different projects.

<!> Note that while the system is called "portage", the actual program you will most often use at the command line is "emerge".

<!> For more in information on Portage, check out Cal's post in the forum.

To search for a particular package by name (or a portion of a name), use the -s option:

emerge -s magick

Once you know the name of the package you would like to install, use the -pv option of first "pretend" (the v means "verbose" or "more detail" and is often useful to get extra information from portage).

emerge -pv imagemagick

From this "pretend" install, you can see what "use flags" (or options) are on (generally red), and which off (appearing with a "-" before their names and generally blue). Check this list carefully and [:PortageUseFlags:adjust the use flags] to match the features you plan to use. If you change the use flags, do another "pretend" emerge to check that your changes are properly reflected.

Other symbols and color indicate flags that have changed in some way since a previous installation of the same package. Remember it is totally safe to re-emerge software packages, in fact it's important to do so to upgrade software, or when you make changes to use flags (to add or remove features from a software).

Also, a "pretend" install will display the complete list of other software that portage needs to install in addition to the one you've requested. Note that these dependencies will depend in large part on the use flags you specify (enabling a flag may require additional packages, removing a flag may simplify the install).

SAMPLE OUTPUT:

[ebuild     U ] media-gfx/imagemagick-6.3.5.10 [6.3.3] USE="X doc graphviz jpeg mpeg perl png tiff truetype xml zlib -bzip2 -fpx -gs -hdri% -jbig -jpeg2k -lcms -nocxx -openexr% -q32% -q8% -wmf" 7,394 kB 

In the above output, portage is indicating (via the "U") that an older version of the software is already installed (version 6.3.3), but that a newer version is available, so if you were to emerge the package, you would be upgrading it. If this was the first time you would be installing the software, you would see an "N", and if you already have the same version of the software, you'd see a "R" for a reinstall.

To actually perform the installation, you could say:

emerge -av imagemagick

The 'a' option (not required), will ask one more time before installing. This is a good option to get into the habit of using in case you go to install some software quickly and don't realize that an enormous amount of dependencies will need to be installed first.