LinuxCommandLibrary

dnf-group

Manage package groups (install, remove, list)

TLDR

List DNF groups, showing installed and uninstalled status in a table

$ dnf [[grp|group]] list
copy

Show DNF group info, including repository and optional packages
$ dnf [[grp|group]] info [group_name]
copy

Install DNF group
$ dnf [[grp|group]] install [group_name]
copy

Remove DNF group
$ dnf [[grp|group]] remove [group_name]
copy

Upgrade DNF group
$ dnf [[grp|group]] upgrade [group_name]
copy

SYNOPSIS

dnf [global-options] group <subcommand> [<group>...] [<subcommand-options>]

PARAMETERS

list
    Lists groups: use available, installed, or environment [id] for specifics

info <group>
    Displays detailed info on a group, including package types

install <group> [pkg...]
    Installs a group or specific packages within it

remove <group> [pkg...]
    Removes a group or specific packages from it

upgrade <group>
    Upgrades all packages in a group

summary
    Shows summary of installed vs. available groups

--with-optional
    Includes optional packages during install/upgrade

--without-optional
    Excludes optional packages (default behavior)

--with-addons
    Includes addon packages in the group

--without-addons
    Excludes addon packages

--skip-broken
    Skips packages causing dependency problems

DESCRIPTION

The dnf group command is a powerful subcommand of the DNF package manager used on RPM-based Linux distributions like Fedora, RHEL, and CentOS. It allows users to handle software groups, which are curated collections of packages designed for specific purposes, such as Development Tools, Web Server, or Graphical Administration Tools. These groups simplify package management by enabling bulk installation, removal, upgrading, and querying of related software stacks.

Key functionalities include listing available or installed groups, displaying detailed information about a group (including mandatory, default, and optional packages), installing entire groups with options for subsets, and removing them. Environment groups provide higher-level collections for desktop environments or servers. This command relies on metadata from repositories, typically in comps.xml files, ensuring consistency across systems.

It's especially useful for system administrators setting up new servers or workstations, as it reduces the need to manually track dependencies across dozens of packages. Global DNF options like --assumeyes (-y) for non-interactive use integrate seamlessly.

CAVEATS

Group definitions depend on repository comps.xml files; availability varies by repo. Not all repos provide groups. Use --allowerasing cautiously with remove to allow dependency breaks.

SUBCOMMAND EXAMPLES

dnf group list available
dnf group install "Development Tools" --with-optional
dnf group info "Web Server"

GROUP TYPES

Mandatory (always installed), default (usually installed), optional (user-selected), and addons (extensions)

HISTORY

Introduced with DNF 1.0 in Fedora 22 (2015) as a modern replacement for YUM's group commands. DNF, developed by Fedora Project since 2012, improved on YUM's group handling with better dependency resolution and libdnf library support. Backward-compatible with YUM groups via migration tools.

SEE ALSO

dnf(8), yum(8), dnf5(8)

Copied to clipboard