3.9 Diverting from the official tree

Using a Portage tree subset

Excluding packages/categories

You can selectively update certain categories/packages and ignore the other categories/packages. We achieve this by having rsync exclude categories/packages during the emerge --sync step.

You will have to define the name of the file that contains the exclude patterns in the RSYNC_EXCLUDEFROM variable in your /etc/make.conf:

RSYNC_EXCLUDEFROM=/etc/portage/rsync_excludes

As an example, let us exclude all games from /etc/portage/rsync_excludes:

games-*/*

Note however that this may lead to dependency issues since new, as allowed packages might depend on new but excluded packages.

Adding unofficial ebuilds

Defining a Portage overlay directory

You can ask Portage to use ebuilds that are not officially available through the Portage tree. Create a new directory (for instance, /usr/local/portage) in which you will store the third-party ebuilds. Use the same directory structure as the official Portage tree!

Then define PORTDIR_OVERLAY in /etc/make.conf, making it point to the previously defined directory. When you use Portage now, it will take those ebuilds into account as well without removing/overwriting those ebuilds the next time you run emerge --sync.

Working with several overlays

For the powerusers who develop on several overlays, test packages before they hit the Portage tree or just want to use unofficial ebuilds from various sources, the app-portage/layman package brings you layman, a tool to help you keep the overlay repositories up to date.

Configure layman and add your desired repositories with layman -a overlay-name.

Suppose you have two repositories called java (for the in-development java ebuilds) and entapps (for the applications developed in-house for your enterprise). You can update those repositories with the following command:

layman -S

Non-Portage maintained software

Using Portage with self-maintained software

In some cases you want to configure, install and maintain software yourself without having Portage automate the process for you, even though Portage can provide the software titles. Known cases are kernel sources and nVidia drivers. You can configure Portage so it knows that a certain package is manually installed on your system. This process is called injecting and supported by Portage through the /etc/portage/profile/package.provided file.

For instance, if you want to inform Portage about vanilla-sources-2.6.37.2 which you have installed manually, add the following line to /etc/portage/profile/package.provided:

sys-kernel/vanilla-sources-2.6.37.2
Thank you!