Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fix for package running dnf5 on fedora #9520

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

larhauga
Copy link

Hi,
on fedora 41 we experience the following errors due to the new dnf version, dnf5 (https://docs.fedoraproject.org/en-US/fedora/latest/release-notes/sysadmin/#dnf-5).

Error: Execution of '/usr/bin/dnf -d 0 -e 1 -y install XX' returned 2: Unknown argument "-d" for command "dnf5". Add "--help" for more information about the arguments.

The flags '-d' and '-e' have as a workaround been removed for newer versions of fedora.

This fixes #9506

Fedora 41 introduced dnf5 which has deprecated the use of the flags '-d'
and '-e'. As a workaround, this change will exlude the flags when
running on fedora >= 41.

Signed-off-by: Lars Haugan <[email protected]>
@larhauga larhauga requested a review from a team as a code owner November 13, 2024 20:14
@puppetlabs-jenkins
Copy link
Collaborator

Can one of the admins verify this patch?

@CLAassistant
Copy link

CLAassistant commented Nov 13, 2024

CLA assistant check
All committers have signed the CLA.

@Stricken1670
Copy link

Stricken1670 commented Nov 15, 2024

I just tested the PR, works great. Up next: group support.

hbo@habocp3 ~/Downloads %  sudo puppet agent -t
Info: Refreshing CA certificate
Info: CA certificate is unmodified, using existing CA certificate
Info: Refreshing CRL
Info: CRL is unmodified, using existing CRL
Info: Using environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Notice: Requesting catalog from puppet:8140 (10.10.8.6)
Notice: Catalog compiled by theforeman.example.com
Info: Caching catalog for habocp3.example.com
Info: Applying configuration version '1731659031'
Notice: /Stage[main]/Desktop_fedora::Gnome/Package[gnome-tweaks]/ensure: created
Notice: /Stage[main]/Desktop_fedora/Service[rpc-statd-notify.service]/ensure: ensure changed 'running' to 'stopped' (corrective)
Notice: /Stage[main]/Desktop_fedora::Gnome/Yum::Group[workstation-product-environment]/Exec[yum-groupinstall-workstation-product-environment]/returns: Unknown argument "groupinstall" for command "dnf5". Add "--help" for more information about the arguments.
Notice: /Stage[main]/Desktop_fedora::Gnome/Yum::Group[workstation-product-environment]/Exec[yum-groupinstall-workstation-product-environment]/returns: It could be a command provided by a plugin, try: dnf5 install 'dnf5-command(groupinstall)'
Error: 'yum -y groupinstall 'workstation-product-environment'' returned 2 instead of one of [0]
Error: /Stage[main]/Desktop_fedora::Gnome/Yum::Group[workstation-product-environment]/Exec[yum-groupinstall-workstation-product-environment]/returns: change from 'notrun' to ['0'] failed: 'yum -y groupinstall 'workstation-product-environment'' returned 2 instead of one of [0] (corrective)
Info: Class[Desktop_fedora::Gnome]: Unscheduling all events on Class[Desktop_fedora::Gnome]
Notice: /Stage[main]/Desktop_fedora::Rstudio/Package[rstudio]/ensure: created
Info: Stage[main]: Unscheduling all events on Stage[main]
Notice: Applied catalog in 21.83 seconds                                                                                                                                                                                                                                                                                   

@Stricken1670
Copy link

Stricken1670 commented Nov 15, 2024

If I recall correctly, for dnf4, the old options were already deprecated. I don't know if dnf3 is still in use somewhere or how old it is, rocky linux 8 already uses dnf4. centos 7 also uses dnf4.

Perhaps we can do away with the conditionals altogether?

from the centos 7 dnf manpage:

       -e <error level>, --errorlevel=<error level>
              Error output level. This is an integer value between 0 (no error output) and 10 (shows all error messages), default is 3. Deprecated, use -v instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

puppet agent not working with dnf5
5 participants