System update guide

Updated 17 January 2020

Calculate Utilities


Updating Calculate Linux is as simple as can be. To update your system, simply run "Update Calculate Linux" in the graphical client, or the following in the command line:


The program will synchronize the Portage tree and the overlays, update the packages and remove obsolete dependencies.

cl-update can be run both from root and from an ordinary user, provided that they have the necessary privileges (see. chapter Users):


Update stages

cl-update's operation consists of two parts: repository synchronization and package update. You may want to synchronize the repos without updating software. To do this, use the -s (--sync-only) option, as shown below:

cl-update --sync-only

Repo synchronization

Calculate Linux provides several binary mirrors for updates, described in the Calculate overlay. cl-update will detect broken or unavailable mirrors automatically, as well mirrors being updated, and switch to the fastest mirror if necessary. To rescan the mirrors manually at any time, run cl-update --scan. The scan log is saved at /var/log/calculate/binhost-scan.log.

Two types of mirror are available: stable and testing. The testing mirrors provide newer package versions. To enable them, run cl-update --stable off.

All packages re not updated at the same time. For all package versions to match those of the Portage tree and those of the Calculate and Distros overlays, cl-update reads the number of the corresponding Git commit on the mirror and then synchronizes the Portage tree and the overlays with it. The commit tags, the most economical set point for Portage updates, are the only difference between the Gentoo copy of the Portage tree used by Calculate Linux.

Own overlays are an important part of Calculate Linux. They are essential for your system. They allow you to edit USE flags and package masks, set variables, add ebuids. In Calculate Linux, overlays can contain templates. All Calculate Linux distributions include at least the Calculate overlay, containing all necessary settings and CU templates. The official CL builds also include Distros, that only stores the differences between CL flavours, thus allowing Calculate users to create their own fully functional customized fork of the distribution.

System configuration

After the synchronization and before the update, migration templates are applied. They configure the selected repository by editing /etc/portage/make.conf/binhost. At this stage, revision and migration templates can be applied.

Modifications can be made by downgrading an installed package, the modified version to be reinstalled. Once the modifications completed, the version of any such package will end with rc73. Here is a less common example of modification: removing an obsolete package that blocks dependency calculation from /var/lib/portage/world.

Package update

If there were modifications, cl-update will start emerge to calculate the dependencies. It may take time, as emerge does not do in parallel, thus requiring important calculations.

If USE flags or package masks were modified, or third-party packages installed, the respective packages will be recompiled from source at installation time. Binary packages are marked in green and non-binary packages in brown.

Recompilation of customized packages

cl-builder-update does this to update the packages inside the system image in order to guarantee that the modified packages get recompiled in time. At this stage, modifications of slots, USE flags and package dependencies will be checked for. If there are modifications, the packages will be recompiled.

Update of Perl modules

If dev-lang/perl was rewritten at update time, cl-update will call perl-cleaner all to update the Perl modules.

System cleanup

When you install software, additional packages are often installed as dependencies. Dependencies may change with time, and applications be removed. This may result in orphan dependencies, that should be deleted. They will not be updated, as emerge does not take them into account any more when calculating dependencies. At this stage, cl-update will remove them by calling emerge --depclean.

If the kernel version to be deleted is actually the current one, the kernel package will be excluded from the list. This means that you can always roll back to the previous version of the kernel (to be selected in the Grub menu), should the new one fail to work normally.

To prevent the current version of PostgreSQL from being removed at major upgrade time, CU templates add the relevant package together with its slot number to /var/lib/portage/world when calling emerge --config postgresql.

Update of kernel modules

If the kernel is updated, cl-update will call emerge @module-rebuild at this stage to also update its modules.

Update of X.Org modules

When updating x11-base/xorg-server, cl-udpate will call emerge @x11-module-rebuild to also update its modules.

Recompiling module dependencies

At update times, cl-update will detect packages that are using obsolete libraries, to be recompiled. To do this, cl-update will call emerge @preserved-rebuild.

Checking reverse dependencies

Optionally, you may want to run revdep-rebuild, provided with the app-portage/gentoolkit package. It searches for packages that contain corrupted executables and libraries. To enable it, run the following command:

cl-update --revdep-rebuild

Useful options

By default, third-party overlays are not synchronized. To synchronize all enabled overlays, use the -o (--update-other) option with cl-update. Example:

cl-update -o

To calculate the dependencies without actually installing anything in emerge-like mode, use the -p (--pretend) option. Example:

cl-update -p

To view the list of the calculated dependencies with their USE flags in an emerge-like mode, use the -e (emergelist) option, as shown below:

cl-update -e

To restore the Portage tree and the overlays (for instance, after manual update), use the -C (--check-repos) option, as shown below:

cl-update -C

Updating the /var/lib/portage/world file, which if the list of all system packages, may present useful options. To synchronize your package list to the one of the current nightly build, just run:

cl-update --rebuild-world

Viewing the package list may also resolve blocked packages, that can in fact be conflicting packages in a too big world file.

Merging the world file with the profile package list may prove to be a useful feature as well. For instance, you may want to switch to the distros:CLDM/amd64/20 profile on your Calculate Linux Scratch system. Once this is done, install the MATE environment with all its dependencies simply by running:

cl-update --merge-world

To use less hard disk space, two options can be used: -1 to clear the local history of Git changes and --clean-pkg to remove the obsolete package archives stored on your hard drive. Example:

cl-update -1 --clean-pkg

Integration with other applications

The binary repo must always correspond to the Portage tree. To guarantee this, we worked on integrating cl-update in the system applications.

Launching emerge --syncwill call the CU synchronization module, specified in /etc/portage/repos.conf/zz-calculate.conf. eix-sync, that updates the Portage tree in verbose mode, also calls the CU update method, as specified in /etc/eix-sync.conf. cl-builder-update uses the universal system update module as well.

Automatic update check

The update check is a cron job. You can configure it by editing /etc/cron.d/calculate-update. If an update is available, a /var/lib/calculate/calculate-update/updates.available file will be created. To set the update interval or to disable automatic updates, use cl-setup-update.