1 Templates
Anagnostakis Ioannis edited this page 2026-06-25 03:12:30 +03:00

Templates

A template is a snapshot of a set of package names. Use it to record a system's package set and replay it elsewhere, or to define a named group you install together. Templates live under /etc/slacker/templates/.


Commands

Command What it does
generate-template NAME Snapshot the installed package set into NAME.template.
install-template NAME Install every package the template lists (following include lines).
remove-template NAME Uninstall every package the template lists (removes them from the system).
delete-template NAME Delete the template file only — installed packages are untouched.

Mind the difference: remove-template uninstalls packages (this is slackpkg behaviour); delete-template just removes the file.


Clone a machine's package set

# on the source machine
slacker generate-template snapshot
#   -> writes /etc/slacker/templates/snapshot.template

# copy that file to the target machine's /etc/slacker/templates/, then:
slacker install-template snapshot

Dependency resolution applies to install-template too, so any .dep-declared dependencies are pulled in. See Dependencies.


Includes

A template may pull in other templates with include lines, so you can compose larger sets from smaller ones (for example a base template included by several role templates). Includes are resolved and de-duplicated when the template is loaded.


Notes

  • generate-template snapshots installed package names that are known to a repository (orphans with no repo are skipped).
  • Templates are plain text — you can edit them by hand, add comments, and keep them in version control alongside the rest of your /etc/slacker/ setup.