From Gentoo Wiki
Jump to:navigation Jump to:search
This page is a translated version of the page Handbook:Parts/Portage/CustomTree and the translation is 29% complete.
Outdated translations are marked like this.
Other languages:
Deutsch • ‎English • ‎español • ‎français • ‎italiano • ‎português do Brasil • ‎русский • ‎中文(中国大陆)‎ • ‎日本語 • ‎한국어
Parts Handbuch
Über die Installation
Auswahl des Mediums
Konfiguration des Netzwerks
Vorbereiten der Festplatte(n)
Installation des Stage Archivs
Installation des Basissystems
Konfiguration des Kernels
Konfiguration des Systems
Installation der Tools
Konfiguration des Bootloaders
Arbeiten mit Gentoo
Arbeiten mit Portage
Dateien und Verzeichnisse
Mischen von Softwarezweigen
Zusätzliche Tools
Eigener Portage-Tree
Erweiterte Portage-Features
Zu Beginn
Fortgeschrittene Konfiguration
Modulare Vernetzung
Drahtlose Netzwerke
Funktionalität hinzufügen
Dynamisches Management

Using a subset of the Gentoo repository

Pakete und Kategorien ausschliessen

It is possible to selectively update certain categories/packages and ignore the other categories/packages. This can be achieved by having rsync exclude categories/packages during the emerge --sync step.

Define the name of the file that contains the exclude patterns in the PORTAGE_RSYNC_EXTRA_OPTS variable in /etc/portage/make.conf:

DATEI /etc/portage/make.confAusschluss-Datei definieren
DATEI /etc/portage/rsync_excludesAlle Spiele ausschließen

Beachten Sie, dass dieses Vorgehen zu Abhängigkeits-Problemen führen kann, da neue erlaubte Pakete von neuen aber ausgeschlossenen Paketen abhängig sein können.

Inoffizielle ebuilds hinzufügen

Defining a custom repository

It is possible to ask Portage to use ebuilds that are not officially available through the Gentoo repository. Create a new directory (for instance /usr/local/portage) in which to store the 3rd-party ebuilds. Use the same directory structure as the official Gentoo repository!

root #mkdir -p /usr/local/portage/{metadata,profiles}
root #chown -R portage:portage /usr/local/portage

Next, pick a sensible name for the repository. The next example uses "localrepo" as the name:

root #echo 'localrepo' > /usr/local/portage/profiles/repo_name

Tell Portage that the repository master is the main Gentoo repository, and that the repository should not be automatically synchronized (as it is not backed by an rsync server, git mirror or other repository source):

DATEI /usr/local/portage/metadata/layout.conf
masters = gentoo
auto-sync = false

Finally, enable the repository on the local system by creating a repository configuration file inside /etc/portage/repos.conf, informing Portage where the local repository can be found:

DATEI /etc/portage/repos.conf/localrepo.conf
location = /usr/local/portage

Mit mehreren Overlays arbeiten

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

Alternatively, install app-eselect/eselect-repository to utilize the native synchronization in Portage. See also Eselect/Repository


Adding repositories is simple with this tool.

For instance, to enable the hardened-development overlay:

root #eselect repository enable hardened-development

Updating of overlays added with this methods happens naturally with:

root #emerge --sync


First install and configure layman as shown in the Overlays User Guide, and add the desired repositories with layman -a.

Aktivieren Sie beispielsweise das hardened-development Overlay:

root #layman -a hardened-development

Regardless of how many repositories are used through layman, all the repositories can be updated with the following command:

root #layman -S

For more information on working with overlays, please read man layman and the previously linked layman/overlay users' guide.

Non-Portage maintained software

Using Portage with self-maintained software

Sometimes users want to configure, install and maintain software individually without having Portage automate the process, even though Portage can provide the software titles. Known cases are kernel sources and Nvidia drivers. It is possible to configure Portage so it knows that a certain package is manually installed on the system (and thus take this information into account when calculating dependencies). This process is called injecting and is supported by Portage through the /etc/portage/profile/package.provided file.

For instance, to inform Portage about gentoo-sources-4.9.16 which has been installed manually, add the following line to /etc/portage/profile/package.provided:

DATEI /etc/portage/profile/package.providedMarking gentoo-sources-4.9.16 as manually installed
This is a file that uses versions without an = operator.