Dnf command to add "excludepkg=stuff*" to epel repo?

I have a bunch of Fedora boxes that need an exclusion added to the epel repo. Is there a DNF command that can do this for me?

I’m envisioning something like this:
dnf config-manager --save --setopt="epel.excludepkgs=stuff*"

I’d rather do it this way instead of having to edit /etc/yum.repos.d/epel.repo and then adding excludepkgs=stuff* on every machine.

Thanks, all!

As an example,
sudo dnf config-manager setopt updates-testing.excludepkgs="ImageMagick*,python3*"

To clear it,
sudo dnf config-manager unsetopt updates-testing.excludepkgs

You can get the repo id from: sudo dnf repolist

https://dnf5.readthedocs.io/en/latest/dnf5.conf.5.html#dnf5-conf-label
https://dnf5.readthedocs.io/en/latest/dnf5_plugins/config-manager.8.html

1 Like

The epel repository should not be enabled on Fedora systems. This repository is only relevant on RHEL, CentOS, Rocky, Alma or similar RHEL compatible distributions.

The contents of the epel repository are Fedora packages recompiled to be compatible with RHEL.

1 Like