Mixing branches
Updated 7 November 2026
This page applies to Portage 3.0.82 and Calculate Utilities 3.8.
The programs of the Portage tree are split between two branches: stable and testing. The ACCEPT_KEYWORDS variable sets which of them the system considers acceptable, while keyword and mask files decide the fate of individual packages. Portage basics are covered on the Introduction to Portage page.
Using one branch
Stable
The ACCEPT_KEYWORDS variable determines which software branch the system uses. By default, Calculate Linux is configured for the stable branch: the variable takes the value of your architecture - for 64-bit systems this is amd64. You do not need to set it explicitly in the configuration.
The stable branch less often results in instability and other problems, so cautious users are advised to stay on it, opening testing versions of packages only occasionally - how it is done is described in the Using stable and testing packages together section.
Testing
Осторожно: тестовая ветвь
Software run from the testing branch may bring stability problems, incorrect package handling (for example, wrong or missing dependencies), frequent ebuild revisions - and therefore frequent rebuilds - and packages breaking in unexpected ways. Users who are not ready to deal with such problems on their own should stick to the stable, more thoroughly tested branch.
If you still need the latest software, the system is switched to the testing branch: add ~ (tilde) before the architecture name in the ACCEPT_KEYWORDS value. The rule works for any architecture. In Calculate, the variable is set in the user file /etc/portage/make.conf/custom - that file and other settings are covered on the Configuring your system with variables page:
/etc/portage/make.conf/custom
ACCEPT_KEYWORDS="~amd64"
Профиль не переключают
The branch is not chosen with eselect profile: in the eselect profile list output, alongside dozens of "clean" Gentoo profiles, the active one is marked for the distribution profile - [59] distros:CLD/amd64/20 (stable) *. The mirror's binary packages and the world file templates rely on it; switching the profile will damage the distribution. Configuring the system means USE flags, keywords and masks through the files in /etc/portage (more on USE flags on the USE flags page).
The distribution's binary package server contains only stable versions. For example, nano is represented in the tree by three versions (9.2, ~9.3, 9999), while the server index has only nano-9.2. So, for testing-branch packages, expect a source build on your own machine - for the binary installation path, see the Portage features page.
After the move from the stable branch to the testing one, the regular system update (cl-update) will pull many - often hundreds of - packages up to current upstream versions. This is normal. Keep in mind: after moving to the testing branch, the way back to the stable one may be difficult - except by restoring a backup. If you find a bug in a package, report it to the maintainers - for example, on the Calculate forum - so that it becomes known and gets fixed in updates.
Using stable and testing packages together
package.accept_keywords
You can allow the testing branch for individual packages while keeping the rest of the system stable. To do this, add the package category and name to the /etc/portage/package.accept_keywords file or to a file in the directory of the same name - in Calculate this directory already exists; it is enough to create a file with any name in it.
For example, to make the testing branch available for a single package:
/etc/portage/package.accept_keywords/testing
<category>/<package> ~amd64
Replace [HTML_REMOVED]/[HTML_REMOVED] with the category and name of the package you are opening the testing branch for. The file name reflects its purpose. The package categories, names and versions in this section's examples are illustrative: substitute the ones your system needs.
Testing individual versions
If you need a specific version from the testing branch, but later versions must not be pulled from it, specify the version with the = operator in package.accept_keywords. Version ranges are set with the <=, <, > or >= operators.
The rule is unambiguous: if version information is specified, the operator must be used; if no version is specified - the operator must not be used.
For example, to allow installing one specific version of a package from the testing branch:
/etc/portage/package.accept_keywords/testing
=<category>/<package>-<version>
Replace [HTML_REMOVED]/[HTML_REMOVED]-[HTML_REMOVED] with the category, name and version number you need.
emerge подскажет строку сам
Calculate's default emerge options include --autounmask: when a package lacks a keyword or a mask, emerge prints the ready-made lines after the package list and aborts right away. Copy them into a file in the appropriate directory - or use --autounmask-write, and then emerge will write the needed entries itself, taking configuration protection into account. For more information, see the Portage features page.
Masked packages
package.unmask
Размаскировка — на вашей совести
Developers do not mask packages without a reason. Questions caused by self-unmasked packages are usually not handled in support: such reports risk being ignored or closed with the WONTFIX status. Exercise caution.
Masks are set in the package.mask files of the profiles directory - by default /var/db/repos/gentoo/profiles/. When you try to install a masked package, emerge reports the masking and, as a rule, its reason. If you are ready to accept the risk, add exactly the same line that is in the mask to /etc/portage/package.unmask (into the file, or into a file in the directory of the same name, which already exists in Calculate):
/etc/portage/package.unmask/manual
=<category>/<package>-<version>
Replace [HTML_REMOVED]/[HTML_REMOVED]-[HTML_REMOVED] with the exact mask line: you will see it in the emerge message - unmask it with a copy of that exact line, not from memory. The file name in the directory is up to you. The data in the example is illustrative.
Блокировка диапазоном
If an entry in package.mask covers a range of versions, unmask only the versions you actually need - version operators are covered in the Testing individual versions section.
package.mask
Finally, you can prevent Portage from installing a package or a specific version - this is what masking means. To mask, add the needed line with qualifiers to /etc/portage/package.mask (into the file, or into a file in the directory of the same name, which exists by default):
/etc/portage/package.mask/manual
><category>/<package>-<version>
Replace [HTML_REMOVED]/[HTML_REMOVED]-[HTML_REMOVED] with the category, name and version number beyond which updates are undesirable; the > sign before the name is a version comparison operator - it is what masks everything newer than the specified one. The file name in the directory is up to you. Such a line will forbid installing all versions of the package newer than the specified one - for example, this is how kernel sources are held back from updating. The data in the example is illustrative.