Managing Sets of Packages Using DNF Groups

Sets of packages can be organized and managed as a group to provide everything that you might need for a particular function.

Examples include the groups for setting up a virtualization host, a graphical desktop, a collection of fonts, or core system administration tools.

Groups contain listings of packages that are required as mandatory for the base functionality of the group, default packages that are installed for the group on most systems, and optional packages that you might decide to install for extra functionality.

Groups can also be nested so that a parent group contains a set of subgroups that can be installed.

For a list of dnf commands that are commonly used to manage DNF groups, see Table 7-2 of DNF Command References.

  • To list all package groups, use the dnf group list command.
    For example, to list all groups with their respective ID values, run:
    dnf group list --ids

    You can use the --installed, --available, and --hidden options to list particular group types.

  • To view group info, such as any subgroups or packages, use the dnf group info command.

    To view the information for the Core group, which contains the minimal number of packages that can be installed on a system, run:

    dnf group info core

    Note that groups can contain subgroups. For example, the "Server with GUI" group contains many subgroups. When you use the dnf group info command on these parent groups, the subgroups are listed. You might need to run the command again on each subgroup to finally see the package listings for each subgroup.

  • To install a group package, use the dnf group install command.

    For example, to install the default packages from the "Server with GUI" group, run:

    sudo dnf group install "Server with GUI"

    You can also use the group id with the group install command:

    sudo dnf group install graphical-server-environment

    Use the --with-optional option to also install optional packages from the group.

    To limit the packages installed for a group to only the mandatory package list, you need to set the DNF group default package types temporarily, for example:

    sudo dnf --setopt=group_package_types="mandatory" group install graphical-server-environment