Search:  
Gentoo Wiki

Portage_and_Ebuilds

Contents

Portage and Ebuilds

Gentoo has a package management system called portage.

It distills the process of building a program from its source code into one command: "emerge <program name>".

When you type emerge <program name>, it finds an 'ebuild', which is a text file that explains how to:

  1. Download the source code for the program you want (lists addresses to get it)
  2. Apply any patches (recent updates/changes, they come as small snippets of code that are inserted into the source you just downloaded)
  3. Go through the steps of putting together the source code.
  4. Install it to the right location, keeping track of it so you can remove it later by typing "emerge unmerge <program name>"

You can sit back and watch that all scroll by when it's building your program for you.

Emerging

Code can be built with different options. For instance, some people need a program to support printing, and some may want support for sound (like for AIM) while others do not. These parts of the program can be added or removed when you run 'emerge'. We manage them using "USE flags", which are appropriately named - USE this component.

For instance, to emerge gaim (aol instant messenger clone) with sound, you could do:

USE="esound" emerge gaim

To add support for kde (a desktop environment), you could do:

USE="kde" emerge <program name>

Removing parts you don't want is just as easy. If you don't like the annoying dings gaim makes, then disable it by putting a minus before the USE flag.

USE="-esound" emerge gaim

You'll find that USE flags are helpful to add features, because if it needs any other programs to make the feature work, it will fetch them for you without any extra effort.

Removing

To remove packages simply:

emerge -C kde

Searching

To search through the portage tree just:

emerge -s kde

However you might not know the name of the package your looking for so:

emerge -S kde

will search through the package names AND descriptions.

Updating

However two of the most important commands for portage are to keep your machine up-to-date (the whole joy of gentoo really!):

emerge --sync

Sync'ing updates the portage tree. This should only really be done once per day.

emerge -avuD world

This last command will show you a list of the packages which emerge now wants to update and which use flags are set. After reviewing the list type yes and it will begin updating your system. This is much more efficient than using -p flag as it forces you to calculate which ebuilds need updating twice.

etc-update

Retrieved from "http://www.gentoo-wiki.info/Portage_and_Ebuilds"

Last modified: Wed, 15 Oct 2008 00:23:00 +0000 Hits: 13,397