Additional functionality of Portage

Updated 7 November 2026

This page applies to Portage 3.0.82 and Calculate Utilities 3.8.

Configuration file protection

When installing a package, Portage leaves the configuration files in directories protected by the CONFIG_PROTECT variable untouched: when a new version of a file needs to go into such a directory, Portage creates a file of the form ._cfg0000_[HTML_REMOVED] next to it. The utilities described below help accept these changes.

etc-update

etc-update updates the ._cfg0000_[HTML_REMOVED] files: it offers interactive configuration of the installation and can apply trivial changes automatically. Running it is simple:

etc-update

First the utility handles trivial updates on its own, then it shows the list of protected files awaiting replacement. Enter the number to the left of a file to process it individually, -1 to exit, -3 to automatically replace all remaining files, or -5 to replace them automatically without using mv -i. Before a mass replacement, be sure to pick out the files that should not be updated automatically.

dispatch-conf

dispatch-conf updates configuration files while keeping a change history: differences are stored as patches or through the RCS version control system, so if a mistake is made the file can be reverted to the previous version at any time. Like etc-update, it lets you keep a file as is, take the new one, edit the current one, or merge changes interactively; pleasant additions are automatic acceptance of files where only comments changed, and of files that differ only in the number of spaces.

First, edit /etc/dispatch-conf.conf and create the archive directory for changed configurations set by the archive-dir parameter; in the standard configuration this is ${EPREFIX}/etc/config-archive, i.e. /etc/config-archive. Then run:

dispatch-conf

Each changed file is shown one by one, controlled by single keys:

Key Action
u update: replace the current configuration file with the new one and move to the next
z zap: delete the new file and move to the next
n next: skip the file, leaving the merge for a future run
q quit: exit the program at any time

Once all files are processed, dispatch-conf exits on its own. Details on interactive merging, editing new files, and comparing versions are on the help page:

man dispatch-conf

cl-dispatch-conf

Calculate Linux also has cl-dispatch-conf - a calculate wrapper over dispatch-conf. File processing works the same there, and the only option is -f/--force, which disables prompts during the process:

cl-dispatch-conf -f

Search and browsing

eix

eix searches the Portage tree through a prebuilt database, so it runs faster than the regular emerge --search. In Calculate Linux eix is already installed, and its database is updated automatically after every repository sync - the distribution enables the /etc/portage/postsync.d/50-eix-postsync hook for this. If the repositories have not been synced yet, run cl-update -s first (see Introduction to Portage). To search for a package with nano in its name, run:

eix -e nano
* app-editors/nano
     Available versions:      9.2 ~9.3 **9999*l {debug justify magic minimal ncurses nls +spell unicode verify-sig}
     Home page:     https://www.nano-editor.org/ https://wiki.gentoo.org/wiki/Nano/Guide
     Description:              GNU GPL'd Pico clone with more functionality

Full details on working with eix are on the Eix page; the same page mentions eix-diff - a script that compares two eix caches, for example the tree state before and after a sync.

The gentoolkit suite

The gentoolkit utilities for querying the package database and managing USE flags are also installed on the system:

Command Purpose
equery queries to the package database: contents, file ownership, USE flags
euse viewing and managing USE flags
ekeyword editing the KEYWORDS field in an ebuild file
qmerge fetches a prebuilt binary package from the server and installs it
quickpkg creating archives of already installed packages
revdep-rebuild finding and reinstalling packages with broken dynamic links

equery

equery files <package> lists the files of an installed package; with the --filter option the output keeps only the needed file categories - for example, --filter=doc leaves the documentation installed under the doc flag:

equery files --filter=doc eselect
/usr/share/doc/eselect-1.4.32/AUTHORS.bz2
/usr/share/doc/eselect-1.4.32/ChangeLog.bz2
/usr/share/doc/eselect-1.4.32/NEWS.bz2
/usr/share/doc/eselect-1.4.32/README.bz2

equery b <file> tells which package a system file comes from. equery uses <package> lists the USE flags of a package but not their descriptions - euse -i provides those.

euse

euse works with global flags (from make.globals, make.defaults, make.conf, use.force, use.mask) and local ones (from package.use and ebuild files). Main options:

Option Action
-i/--info show the descriptions of the given flags
-I/--info-installed the same, but only for flags of installed packages
-g/--global consider global flags
-l/--local consider local flags
-a/--active show active flags
-E/--enable enable a flag
-D/--disable disable a flag
-R/--remove (alias -P) remove a flag
-p/--package apply to a specific package together with -E/-D/-R

How USE flags work and how to set them permanently is described on the USE flags page.

ekeyword, qmerge and revdep-rebuild

ekeyword edits the KEYWORDS field in ebuild files. To accept testing versions in Calculate Linux, it is more reliable to use the /etc/portage/package.accept_keywords files - see Mixing branches.

qmerge downloads a prebuilt binary package from the server and installs it.

revdep-rebuild finds packages with broken dynamic links (they appear, for example, after a library update) and reinstalls them.

quickpkg

quickpkg creates archives of packages already installed on the system: just add the names of the packages to archive.

quickpkg [HTML_REMOVED]

Instead of [HTML_REMOVED], specify one or more installed packages. The resulting archives are prebuilt binary packages: quickpkg writes them to the binary package directory set by the PKGDIR variable; in Calculate Linux this is /var/calculate/packages/x86_64, so the usual Gentoo path /var/cache/binpkgs does not apply here. Files are named after the package category, name, and version, for example app-editors/vim-9.2.1202.tbz2. Installing from such archives is covered on the Binary packages page, and a detailed path map is on the Files and directories page.

Security and system updates

glsa-check

Security updates are published as GLSA (Gentoo Linux Security Advisory) bulletins. Check whether the system is affected by any of the listed bulletins:

glsa-check -t all
This system is not affected by any of the listed GLSAs

cl-update

A full system update in Calculate Linux runs through cl-update: it syncs the repositories, updates world, applies templates, and looks after config file protection. Individual packages are still installed with emerge, but the standard route for a full update is cl-update, not emerge -DuNa @world. The tool is introduced on the Introduction to Portage page; below is the list of main options.

cl-update --help
usage: cl-update [--stable [ON/OFF]] [--scan [ON/OFF]]
                 [--with-bdeps [ON/OFF/AUTO]] [-m MIRROR_URL]
                 [--repo-update REPOSITORY URL] [-o [ON/OFF/AUTO]]
                 [-s [ON/OFF]] [-p [ON/OFF]] [-r REPOSITORIES] [-e [ON/OFF]]
                 [-C [ON/OFF]] [--force-fix [ON/OFF]]
                 [--ignore-level [ON/OFF]] [--force-level LEVEL]
                 [--rebuild-world | --merge-world | --update-world]
                 [--force-check-sign | --skip-check-sign | --auto-check-sign]
                 [--force-egencache | --skip-egencache | --auto-egencache]
                 [--force-eix-update | --skip-eix-update | --auto-eix-update]
                 [-R [ON/OFF]] [--wait-another-update [ON/OFF]]
                 [--schedule [ON/OFF]] [-1 [ON/OFF/AUTO]]
                 [--clean-pkg [ON/OFF]] [--branch REFS] [-T TEMPLATES]
                 [-v [ON/OFF]] [--usenew-conf | --skip-conf | --dispatch-conf]
                 [--exclude exclude] [-f]
Option Purpose
-s/--sync-only sync the repositories only, without updating packages
-p/--pretend show what will be done, without installing
--stable update only to stable versions
-m/--mirror-update set the binary package server; cl-update -m list shows the options
--scan select the closest update server
-r/--repositories choose which repositories to sync
--exclude exclude a package from the update list
--force-eix-update/--skip-eix-update force or skip the eix database update
--usenew-conf/--skip-conf/--dispatch-conf configuration policy: use the new configuration files, skip their update, or update them manually via dispatch-conf by default (see Configuration file protection)
--rebuild-world rebuild the system package list; --merge-world adds the profile package list, --update-world updates it (default)
--branch set refs for the repositories (REPOSITORY:REF format)