| XBPS.HOOK(5) | File Formats Manual | XBPS.HOOK(5) |
xbps.hook — XBPS
hook configuration
The xbps.hook files are
‘.ini’-style configuration files to define hooks that execute
commands at certain points of the xbps transactions (package updates,
installs, and removals.)
Comments can be put anywhere in the file and using hashmarks (‘#’), or semi-colons (‘;’), and are continued to the end of the line.
The Hook section is required and defines
when the hook is executed and the command that is being executed as part of
the hook.
When
= option ...PreTransactionPostTransactionA hook is executed if it's Match section
matches the current transaction.
Package
= pkgname |
pkgpatternPackageInstall
= pkgname |
pkgpatternPackageUpdate
= pkgname |
pkgpatternPackageRemove
= pkgname |
pkgpatternPackageReinstall
= pkgname |
pkgpatternPackageConfigure
= pkgname |
pkgpatternPath
= path | patternPathCreated
= path | patternPathModified
= path | patternPathDeleted
= path | patternOptions which support multiple free text values will be split into separate words. The word boundaries are spaces (‘ ’) and tabs (‘\t’).
If a word contains a literal space (‘ ’) or tab (‘\t’), use a backslash (‘\’) to escape the character.
The following example restarts the sshd
service after the ssh package was updated.
[Hook] Name = Restart sshd. When = PostTransaction Exec = sv restart /var/service/sshd [Match] PackageUpdate = ssh
This example hook will sign the systemd-bootx64.efi file whenever it is updated or installed.
[Hook] Name = Sign the bootloader file. When = PostTransaction Exec = sbsign --key /etc/kernel/secure-boot.key.pem \ --cert /etc/kernel/secure-boot.cert.pem \ --output /usr/lib/systemd/boot/efi/systemd-bootx64.efi.signed \ /usr/lib/systemd/boot/efi/systemd-bootx64.efi [Match] PathModified = /usr/lib/systemd/boot/efi/systemd-bootx64.efi
| December 22, 2025 | Void Linux |