Dnf `--exclude` parameter: What is the correct syntax when multiple packages are involved?

OK, I have read the write-up called Using the DNF software package manager.

What if I wish to exclude multiple packages from being installed?

Using the command line: is the below syntax correct?

sudo dnf install @lxqt --exclude=pavucontrol pulseaudio falkon

Using the dnf configuration file: is the below syntax correct?

--excludepkgs="pavucontrol pulseaudio falkon"

Thanks for your help.

2 Likes

–exclude=package1,package2,package3

config file:

excludepkgs

list

Exclude packages of this repository, specified by a name or a glob and separated by a comma, from all operations. Can be disabled using --disableexcludes command line switch. Defaults to [].

excludepkgs=package1,package2

https://dnf.readthedocs.io/en/latest/conf_ref.html
https://dnf.readthedocs.io/en/latest/command_ref.html

3 Likes

The manual also has examples:

man dnf

and search for exclude= shows, for example:

   Remove Examples                                                                                                                                                                          
       dnf remove acpi tito
              Remove the acpi and tito packages.

       dnf remove $(dnf repoquery --extras --exclude=tito,acpi)
              Remove packages not present in any repository, but don't remove the tito and acpi packages (they still might be removed if they depend on some of the removed packages).
3 Likes