Templates

Updated 11 November 2026

Templates are a Calculate Utilities mechanism that sets up configuration files without manual editing. You describe "what should be" in the file, and the utilities add it to the existing configuration: they keep your other settings, the order of lines, the quotes and comments, link the file to its package, and rewrite it from scratch at every package update.

This solves two problems at once. The system stays up to date with continuous updating: packages change versions and configuration formats, and the templates bring the settings along with them. And the changes stay readable: the template holds only what you wanted to change, not scattered edits across dozens of files in /etc/.

Templates are used everywhere: when building an image, installing the system, running it for the first time, updating the Portage tree, configuring a package, and logging in to a user session.

Getting started

References

Advanced topics