Stepping aside from the official tree
Updated 7 November 2026
This page applies to Portage 3.0.82 and Calculate Utilities 3.8.
Not every package you need is available in the official Gentoo tree, and sometimes you have to adjust the tree configuration to your own needs: add your own ebuild, connect a third-party repository, or, conversely, exclude unneeded categories from updates. In Calculate Linux, much of the preparatory work has already been done by the distribution - the user repository is created and registered in advance.
Using part of the Gentoo repository
Excluding packages and categories
You can selectively update individual categories and packages, ignoring the rest. For this, the rsync program excludes files by patterns from a separate list during synchronization.
Только для rsync-синхронизации
The exclusions take effect only for a repository synchronized over rsync. In a standard Calculate installation, the gentoo repository is updated by the calculate module from a git mirror (see The custom user repository), so this method does not apply to the standard tree - it is meant for repositories that you sync over rsync on your own.
For the method to work, you must disable manifest verification - this lowers the security of the repository. You disable it either by removing the rsync-verify flag due to the USE flag of the sys-apps/portage package, or by the sync-rsync-verify-metamanifest=no parameter in the repository section (parameter descriptions are in the man 5 portage manual page). Repository files created by the distribution must not be edited manually - put your parameter in a separate new file of the /etc/portage/repos.conf/ directory.
The name of the file with exclusion patterns is set by the PORTAGE_RSYNC_EXTRA_OPTS variable in the user file /etc/portage/make.conf/custom (on the purpose of this file - Configuring your system with variables):
/etc/portage/make.conf/custom (фрагмент, пример)
PORTAGE_RSYNC_EXTRA_OPTS="--exclude-from=/etc/portage/rsync_excludes"
For example, to exclude all games, place a single line in the /etc/portage/rsync_excludes file:
/etc/portage/rsync_excludes (пример)
games-*/*
Исключения ломают зависимости
Excluding parts of a repository - the Gentoo tree in particular - leads to dependency problems: newly allowed packages may depend on new but excluded ones. The exclusions are not supported by anyone; proceed with this risk in mind.
Adding unofficial ebuilds
The custom user repository
In Calculate Linux, the user repository has already been created and registered with Portage: it is called custom and is located at /var/calculate/repos/custom, and its master repositories (masters) are calculate and gentoo - eclasses and virtual packages are taken from them. You can verify this in the Repositories section of the emerge --info output:
Repositories:
custom
location: /var/calculate/repos/custom
masters: calculate gentoo
volatile: True
calculate
location: /var/db/repos/calculate
sync-type: calculate
sync-uri: https://github.com/calculatelinux/calculate
masters: gentoo
priority: 50
volatile: False
container
location: /var/calculate/repos/container
sync-type: git
sync-uri: https://github.com/calculatelinux/container
masters: calculate gentoo
priority: 50
volatile: True
distros
location: /var/db/repos/distros
sync-type: calculate
sync-uri: https://github.com/calculatelinux/distros
masters: calculate gentoo
priority: 50
volatile: False
gentoo
location: /var/db/repos/gentoo
sync-type: calculate
sync-uri: https://github.com/calculatelinux/gentoo
priority: 50
volatile: False
The repository skeleton - the metadata and profiles directories with their settings - is created by the distribution, and you do not need to install the layman utility for this: Calculate Linux does not include it. All you need is to create the category and package directories and put the ebuild file there.
The /etc/portage/repos.conf/zz-calculate.conf and /etc/portage/repos.conf/custom.conf files, which register the distribution's repositories, do not belong to packages and must not be edited by hand - add your own repositories with a separate new file in /etc/portage/repos.conf/ (on this, see Creating a separate repository from scratch). If you need to change the distribution's own configuration file, create a template for it - see Templates.
Adding a package to your repository
Step 1. Create the category and package directories. The structure follows the official tree: category, package, and in the package directory - an ebuild file named package-version.ebuild:
mkdir -p /var/calculate/repos/custom/[HTML_REMOVED]/[HTML_REMOVED]
Step 2. Write the ebuild file. Minimal content (example - replace the field values with your own):
/var/calculate/repos/custom/<категория>/<пакет>/<пакет>-<версия>.ebuild (пример)
EAPI=8 DESCRIPTION="Test package" HOMEPAGE="https://example.org" SRC_URI="https://example.org/distfiles/${P}.tar.xz" LICENSE="MIT" SLOT="0" KEYWORDS="~amd64"
How the functions and fields of an ebuild file are organized is described on the Working with ebuild page.
Step 3. Create the Manifest. As long as the package directory does not contain a Manifest file, Portage reports this:
* Manifest not found for '/var/calculate/repos/custom/<category>/<package>/<package>-<version>.ebuild'
The Manifest is created by the manifest command of the ebuild utility:
>>> Creating Manifest for /var/calculate/repos/custom/<category>/<package>
The manifest command changes only your package directory and does not require superuser privileges; commands that change the system (install, qmerge) are run as root.
Step 4. Install the package. From here on, emerge handles the package - it calculates the dependencies and runs the build phases on its own:
emerge -a [HTML_REMOVED]
If the ebuild specifies a testing keyword (for example, KEYWORDS="~amd64"), the package does not make it into the install list right away: first emerge requires you to accept it by keyword and suggests a ready-made line. The wordings of the Portage messages in this section are illustrative: the exact text on your system may differ.
# required by =<package>-<version> (argument) =<package>-<version> ~amd64
The suggested line goes into a file in the /etc/portage/package.accept_keywords directory - the directory is created by the distribution, you only need to create a file in it with any name you like (more on keywords - Mixing branches). After that, emerge -pv will show the package as a regular list. A package with a stable KEYWORDS value (without a tilde) appears in this list immediately, without a keyword entry.
Creating a separate repository from scratch
A repository of your own is needed rarely - only when custom is not enough: for example, for independent masters values or a separate set of profiles. You will have to create it manually.
Step 1. Create the skeleton directories and assign the owner:
mkdir -p /var/db/repos/[HTML_REMOVED]/{metadata,profiles}
chown -R portage:portage /var/db/repos/[HTML_REMOVED]
Step 2. Set the repository name and the profiles EAPI - one line each in the profiles/repo_name and profiles/eapi files:
echo '[HTML_REMOVED]' > /var/db/repos/[HTML_REMOVED]/profiles/repo_name
echo '8' > /var/db/repos/[HTML_REMOVED]/profiles/eapi
Step 3. Describe the repository in the metadata/layout.conf file: specify the master repository and disable automatic synchronization, since the repository has no external source (example):
/var/db/repos/имя-репозитория/metadata/layout.conf (пример)
masters = gentoo auto-sync = false thin-manifests = true sign-manifests = false
Step 4. Tell Portage about the repository - with a new file in /etc/portage/repos.conf/ (example):
/etc/portage/repos.conf/localrepo.conf (пример)
[localrepo] location = /var/db/repos/localrepo
Next, fill the repository directory with categories and packages the same way as described in the Adding a package to your repository section.
Working with multiple repositories
If you develop several ebuild repositories, test packages before they appear in the main tree, or take unofficial files from different sources, it is enough to keep a separate file for each third-party repository in /etc/portage/repos.conf/. An example of connecting an external git repository - in the myoverlay.conf file, replace the section name, directory and address with your own:
/etc/portage/repos.conf/myoverlay.conf (пример)
[myoverlay] location = /var/db/repos/myoverlay sync-type = git sync-uri = https://github.com/example-owner/myoverlay.git masters = calculate gentoo
The added repositories are updated together with the rest of the system by the standard synchronization command:
cl-update -s
The low-level emerge --sync can also be used, but a full tree update is a lengthy operation, without any timing guarantees. A repository with auto-sync = false in metadata/layout.conf is not synchronized automatically - that is by design for repositories with no external source.
Software not maintained by Portage
Portage message about a manually installed package
Sometimes you configure, install and maintain a program yourself, even though Portage could install it. Well-known examples are kernel sources and NVIDIA drivers. You can warn Portage that a package has already been installed manually, and it will take this into account when resolving dependencies. The process is called injecting and is supported by the /etc/portage/profile/package.provided file, a stub of which has been created by the distribution.
For example, to tell Portage about a manually installed sys-kernel/gentoo-sources-6.18.8, add a line to the file:
/etc/portage/profile/package.provided (пример)
sys-kernel/gentoo-sources-6.18.8
Формат файла
In package.provided, versions are given without the = operator - simply category/package-version, one entry per line.