Open xxjack12xx opened 1 month ago
I stumbled upon this, too. My workaround at the moment is
ln -s /usr/local/bin/dnf /usr/bin/dnf4
But that's not something I want to apply to a whole fleet of managed machines, especially as dnf5
and dnf4
seem to be using different databases to keep track of packages, and dnf5
has other improvements we are missing out (smaller downloads, faster operation).
Hi @xxjack12xx, thank you for reporting this issue! While we agree this is likely a bug, we do not anticipate addressing this any time soon due to other issues demanding precedence. However, this is on the team's radar.
FYI, -d
and -e
switches were deprecated in dnf4 already
The switches can be found in ruby/vendor_ruby/puppet/provider/package/dnfmodule.rb
. Currently it is blocking the use of the puppet agent on Fedora 41 for me as i have many modules using packages
.
Here is some example code that triggers the problem:
package{'gnome-tweaks':
ensure => present,
}
And the error:
Error: Execution of '/usr/bin/dnf -d 0 -e 1 -y install gnome-tweaks' returned 2: Unknown argument "-d" for command "dnf5". Add "--help" for more information about the arguments.
Error: /Stage[main]/Desktop_fedora::Gnome/Package[gnome-tweaks]/ensure: change from 'purged' to 'present' failed: Execution of '/usr/bin/dnf -d 0 -e 1 -y install gnome-tweaks' returned 2: Unknown argument "-d" for command "dnf5". Add "--help" for more information about the arguments.
The switches can be found in
ruby/vendor_ruby/puppet/provider/package/dnfmodule.rb
. Currently it is blocking the use of the puppet agent on Fedora 41 for me as i have many modules usingpackages
.
This is for the dnf module
command, so although this code will absolutely have the same problem and will also need fixing, it is not the cause for our problems.
Found the real culprit: puppet/lib/ruby/vendor_ruby/puppet/provider/package/yum.rb
# Yum on el-4 and el-5 returns exit status 0 when trying to install a package it doesn't recognize;
# ensure we capture output to check for errors.
no_debug = Puppet.runtime[:facter].value('os.release.major').to_i > 5 ? ["-d", "0"] : []
command = [command(:cmd)] + no_debug + ["-e", error_level, "-y", install_options, operation, wanted].compact
output = execute(command)
puppet agent does not support dnf5 which is the current package manager in Fedora 41.
When having puppet install a package, the following error occurs: Package[rsync-daemon]/ensure: change from 'purged' to 'present' failed: Execution of '/bin/dnf -d 0 -e 1 -y install rsync-daemon' returned 2: Unknown argument "-d" for command "dnf5". Add "--help" for more information about the arguments. (corrective)