I need to exclude several packages from DNF transactions.
Easy way to do that is to append
That works as expected, but is far from the ideal usage I seek.
I administer dozens of machines, which has different needs for the excluded packages.
(= the list of excluded packages differ between machines)
Each excluded package is managed by a standalone script dealing with the specific OS functionality area.
Which makes is very very ugly to maintain that one line in
I’d like to split the
/etc/dnf/dnf.conf to multiple files, e.g.:
This way I could avoid tainting the default configuration file (which I want to be maintained by the dnf package).
And each script would work with it’s own specific config file, which would both save me the ugliness of re-writing the line in each script, and make it easier to read and understand.
I wasn’t successful in splitting the config file.
On top of that, it seems that the
exclude option for DNF works on “last occurrence wins” basis.
Which IMO makes sense for single-value options, but not for additive-value options.
So in configuration like this:
the last occurrence of specification of the
exclude option wins and invalidates all its previous occurrences, effectively applying only the
exclude=pkg2, while ignoring
Without this solved, I’d avoid tainting of the default config file, but the ugliness of several scripts (and sometimes humans too) fighting over rewriting that single config line will remain.
I believe I am using the
exclude for years, but I wasn’t able to find it in
dnf.conf manpage, only here: DNF Command Reference — DNF @DNF_VERSION@-1 documentation
-x <package-file-spec>, --exclude=<package-file-spec>
Exclude packages specified by <package-file-spec> from the operation.
Deprecated option. It was replaced by the --exclude option.
All other sources I’ve come by use the
Not sure whether they behave differently.