DNF4-POST-TRANSACTION-ACTIONS(8)
Heyyy bestie! π You're reading the dnf4-post-transaction-actions(8) manual page, and it's literally about the DNF post transaction actions Plugin. By the end of this, you're gonna be defining actions like a total Unix main character. Let's go! β¨
πΈ NAME πΈ
dnf4-post-transaction-actions β DNF post transaction actions Plugin
π DESCRIPTION π
Okay so here's the tea: this plugin allows you to define actions that get executed upon completing an RPM transaction. No cap. Each action may define a (glob-like) filtering rule on the package NEVRA or package files, and it can also specify whether the package was installed or removed. Actions are defined in action files. Periodt. π
π CONFIGURATION π
The plugin configuration is in /etc/dnf/plugins/post-transaction-actions.conf. All configuration options are in the [main] section. Slay.
enabledβ Whether the plugin is enabled. Default value isTrue. Highkey useful!actiondirβ Path to the directory with action files. Action files must have the.actionextension. Default value is"/etc/dnf/plugins/post-transaction-actions.d/". Iconic default, ngl.
π¦ ACTION FILE FORMAT π¦
Empty lines and lines that start with a # character are ignored. Each non-comment line defines an action and consists of three items separated by colons: package_filter:transaction_state:command. It's giving format energy, bestie. π¦
β¨ package_filter β¨
A (glob-like) filtering rule applied on the package NEVRA (also in the shortened forms) or package files. This is how you pick which packages get the action, iykyk.
β¨ transaction_state β¨
Filters packages according to their state in the transaction. Here's the breakdown:
inβ packages that appeared on the system (downgrade, install, obsolete, reinstall, upgrade)outβ packages that disappeared from the system (downgraded, obsoleted, remove, upgraded)anyβ all packages
Each one's got its own vibe, fr fr.
β¨ command β¨
Any shell command. The following variables in the command will be substituted:
${name},$nameβ package name${arch},$archβ package arch${ver},$verβ package version${rel},$relβ package release${epoch},$epochβ package epoch${repoid},$repoidβ package repository id${state},$stateβ the change of package state in the transaction:"downgrade","downgraded","install","obsolete","obsoleted","reinstall","reinstalled","remove","upgrade","upgraded"
Okay so the shell command will be evaluated for each package that matched the package_filter and the transaction_state. However, after variable substitution, any duplicate commands will be removed and each command will only be executed once per transaction. Iconic efficiency! The order of execution of the commands follows the order in the action files, but may differ from the order of packages in the transaction. In other words, when you define several action lines for the same package_filter these lines will be executed in the order they were defined in the action file when the package_filter matches a package during the trasaction_state state. (Yes, the original says trasaction_stateβtypo and all, we're keeping it! π) However, the order of when a particular package_filter is invoked depends on the position of the corresponding package in the transaction. It's giving organized chaos and we love to see it. π
An example action file: π«
# log all packages (state, nevra, repo) in transaction into a file.
*:any:echo '${state} ${name}-${epoch}:${ver}-${rel}.${arch} repo ${repoid}' >>/tmp/post-trans-actions-trans.log
# The same shell command (after variables substitution) is executed only once per transaction.
*:any:echo '${repoid}' >>/tmp/post-trans-actions-repos
# will write each repo only once to /tmp/post-trans-actions-repos, even if multiple packages from
# the same repo were matched
Obsessed with this example, honestly. π
π AUTHOR π
See AUTHORS in your Core DNF Plugins distribution. Go check it out bestie! π
π COPYRIGHT π
2014, Red Hat, Licensed under GPLv2+. Slay! π
This page is from version 4.10.1, dated Mar 28, 2025. That's the dnf4-post-transaction-actions(8) manual page, bestie! Hope it slayed. π
β¨
π¦ where this page comes from
- opensuse-leap 16.0: python3-dnf-plugin-post-transaction-actions 4.10.1-bp160.1.7 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms