Functionality of Portage

Updated 7 November 2026

This page applies to Portage 3.0.82 and Calculate Utilities 3.8.

Portage features

Besides core package management, Portage has a number of additional features that speed up installation and make it more reliable - from parallel downloads to isolated builds.

Features are enabled and disabled by the FEATURES variable, a space-separated list of keywords. The distribution already configures the needed set in Calculate Linux, so most of the time you don't have to change anything: to enable or disable a specific feature, set FEATURES in the /etc/portage/make.conf/custom file (the make.conf directory and the user settings in it are covered on the Configuring your system with variables page).

The full list of features with descriptions is on the make.conf help page:

man make.conf

To see which features are active in the current system, run:

emerge --info | grep ^FEATURES=

Enabled by default in Calculate

In a standard Calculate Linux installation, the FEATURES variable contains:

Feature Behavior
getbinpkg makes emerge always try to take packages from a remote binary server (see Binary packages)
parallel-fetch downloads the sources in the background while the current packages are being built
parallel-install uses more fine-grained locks during installation, which lets more packages install in parallel
merge-wait waits for all builds to finish before installing new packages; it only matters when building with --jobs

Not all supported features are listed here - the rest are described on the make.conf help page.

Binary packages

Default installation path

In Calculate Linux, installing from ready-made binary packages is the default path. When resolving dependencies, emerge -pv shows right away where a package will be taken from:

emerge -pv nano
These are the packages that would be merged, in order:

Calculating dependencies ... done!
Dependency resolution took 2.39 s (backtrack: 0/20).

[binary  N g   ] app-editors/nano-9.2::gentoo  USE="ncurses nls (unicode) -debug -justify -magic -minimal -spell -verify-sig" 694 KiB

Total: 1 package (1 new, 1 binary), Size of downloads: 694 KiB

The [binary N g] marker in the line means: the package will be installed from a binary repository; N is a new installation, g is a package from the gentoo repository.

The distribution sets the binary server address - it is stored in the PORTAGE_BINHOST variable of a separate file:

/etc/portage/make.conf/binhost
#------------------------------------------------------------------------------
# Modified Calculate Utilities 3.7.6.8
# Processed template files:
# /var/db/repos/calculate/profiles/templates/6_ac_update_sync/binhost/binhost
# To modify this file, create a /etc/portage/make.conf/binhost.clt template.
#------------------------------------------------------------------------------

PORTAGE_BINHOST="http://mirror.mephi.ru/calculate/grp/x86_64"

Не правьте этот файл вручную

The file is created by a distribution template from the update.cl_update_binhost value. To set your own repository address, create a /etc/portage/make.conf/binhost.clt template (more on the Templates page). cl-update -m list shows the full list of available binary package servers.

Binary packages on the distribution mirror are released in stable versions only, so packages that require the ~amd64 keyword are built from source - more on the Mixing branches page.

Building from source

Building from source is useful when you need to optimize programs for your hardware or set specific USE flags. For both cases, the /etc/portage/make.conf/custom file ships ready-made template lines:

/etc/portage/make.conf/custom (in full)
#------------------------------------
# Основные опции сборки
#------------------------------------
# Использование для обновления бинарных пакетов (по умолчанию) либо
# исходных кодов.
#FEATURES="${FEATURES} -getbinpkg"

# Список пакетов, которые будут всегда устанавливаться из исходного кода.
# Используйте пробел в качестве разделителя.
#USEPKG_EXCLUDE="--usepkg-exclude=''"

# Количество пакетов для одновременной сборки.
#EMERGE_JOBS="--jobs=1"

EMERGE_DEFAULT_OPTS="${EMERGE_DEFAULT_OPTS} ${USEPKG_EXCLUDE} ${EMERGE_JOBS}"

# Конфиги, защищённые от автоматической перезаписи
# В этих путях будут появляться файлы вида ._cfg0000_*,
# которые нужно принимать через etc-update или dispatch-conf.
CONFIG_PROTECT="/var/calculate/etc"

#------------------------------------
# Настройки компилятора
#------------------------------------
# Количество параллельных процессов, запускаемых при установке пакета.
MAKEOPTS="-j5"

# Дополнительные параметры, передаваемые компилятору. Флаг '-march=native'
# оптимизирует программы под ваше оборудование.
#CFLAGS="-O2 -march=native -pipe"
#CXXFLAGS="${CFLAGS}"

# Максимальный размер ccache
#CCACHE_SIZE="5G"

# Параметры сжатия для бинарных пакетов
BINPKG_COMPRESS_FLAGS="-19 -T4"
  • To switch to sources completely, uncomment the FEATURES="${FEATURES} -getbinpkg" line: the minus before a feature name disables installing from binary packages.
  • For individual packages, uncomment USEPKG_EXCLUDE and enter the names after = in quotes, separated by spaces - they will always be built from source.
  • To limit the number of packages built at the same time, uncomment EMERGE_JOBS.

The same --usepkg-exclude option can be applied to a single command without editing the file:

emerge -a --usepkg-exclude '[HTML_REMOVED]' [HTML_REMOVED]

Instead of [HTML_REMOVED], specify the package you need to build from source. When a package is excluded, emerge marks it in the list as [ebuild N ] instead of [binary ...] — такой пакет будет собран из исходников.

Default emerge options

The EMERGE_DEFAULT_OPTS variable sets the options applied to every emerge run. In Calculate it already includes --autounmask: emerge generates the missing settings in package.use automatically and unmasks the packages required by dependencies. If configuration changes are needed, emerge shows them after the package list and aborts right away.

If the changes shown suit you, copy them into the configuration files indicated - or use --autounmask-write: then emerge writes the needed entries itself, and the configuration protection tools dispatch-conf, etc-update or cl-dispatch-conf accept the changes (see Additional Portage functionality).

The ready-made USEPKG_EXCLUDE and EMERGE_JOBS options from /etc/portage/make.conf/custom are substituted into EMERGE_DEFAULT_OPTS automatically.

File downloads

Portage downloads sources and other distribution files to the directory set by the DISTDIR variable; in Calculate Linux this is /var/calculate/distfiles (the detailed path map is on the Files and directories page).

Checking distfiles

To re-check the integrity of the downloaded archives and, if needed, re-download the missing or damaged files of all installed packages, run:

emerge --ask --fetchonly --emptytree @world