dnf-group
Manage package groups (install, remove, list)
TLDR
List DNF groups, showing installed and uninstalled status in a table
Show DNF group info, including repository and optional packages
Install DNF group
Remove DNF group
Upgrade DNF group
SYNOPSIS
dnf group [OPTIONS] <subcommand> [GROUP_SPEC...]
Common Subcommands:
dnf group list [all|installed|available|hidden|mandatory|optional|default|base|end-user]
dnf group info GROUP_SPEC...
dnf group install GROUP_SPEC...
dnf group reinstall GROUP_SPEC...
dnf group remove GROUP_SPEC...
dnf group update GROUP_SPEC...
dnf group mark remove GROUP_SPEC...
dnf group mark install GROUP_SPEC...
GROUP_SPEC can be a group name (e.g., "Development Tools") or a group ID (e.g., "development-tools").
PARAMETERS
-y, --assumeyes
Automatically answer 'yes' for all questions, behaving as if the user confirmed every prompt.
--allowerasing
Allow erasing of installed packages to resolve dependencies. Useful when a package needs to be removed for a dependency to be satisfied or a conflict resolved.
--best
Try to use the best available versions of packages in transactions. This often means preferring the latest available versions.
--installroot=<path>
Specifies an alternative installroot (default is '/'). Useful for chroot environments or creating system images without affecting the host.
--releasever=<release>
Override the value of $releasever as found in repository configuration files. For example, '39' for Fedora 39.
--skip-broken
Skip packages that are causing dependency problems and cannot be resolved. The transaction will proceed with the remaining solvable packages.
--nogpgcheck
Disable GPG signature checking of packages. Use with extreme caution as this compromises system security.
--enablerepo=<repo>
Enable specific repositories by ID or glob that are normally disabled. Can be specified multiple times.
--disablerepo=<repo>
Disable specific repositories by ID or glob that are normally enabled. Can be specified multiple times.
--repofrompath=<name>,<path>
Add an ad hoc repository from a given path (local directory or URL) with a specified name for the current transaction.
--disableexcludes=<repo_id|all>
Disable excludes for a given repository (by ID) or for all repositories. Excludes prevent certain packages from being considered during transactions.
--setopt=VAR=VALUE
Set a configuration option directly. For example, --setopt=install_weak_deps=False to prevent installation of weak dependencies.
DESCRIPTION
dnf-group refers to the capabilities within the
DNF (Dandified YUM) package manager for managing collections of packages known as 'groups'. These groups logically bundle related software for a specific purpose, like 'Development Tools', 'KDE Plasma Workspaces', or 'Server with GUI'. The command simplifies the process of installing, updating, or removing multiple interconnected packages simultaneously, ensuring system consistency and ease of administration. It provides functionalities to list available groups, show detailed info about their contents, and perform lifecycle operations such as install, remove, reinstall, and update on them. By leveraging repository metadata, dnf-group abstracts away the complexities of individual package dependencies, offering a higher-level approach to software management.
CAVEATS
Group operations are heavily dependent on accurate and up-to-date repository metadata. Outdated or corrupted metadata might lead to incomplete or failed transactions.
When using dnf group remove, only packages explicitly installed as part of that group, and not required by other installed packages, will be removed. This means it won't necessarily remove all related packages if they were installed independently or are dependencies of other system components.
While DNF strives to resolve dependencies for groups, complex scenarios or manually installed conflicting packages might require additional troubleshooting.
Group names can sometimes be ambiguous or contain spaces; using group IDs (obtainable via dnf group list id) is often more reliable, especially in scripting.
GROUP PACKAGE STATES
DNF groups classify their constituent packages into distinct states, influencing how they are handled during group operations:
mandatory: These packages are always installed when the group is installed.
default: These packages are installed by default with the group, but users can explicitly deselect them.
optional: These packages are available within the group but are not installed by default; they must be manually selected for installation.
Understanding these states is crucial for predicting and controlling exactly which packages get installed with a group.
GROUP IDS VS. NAMES
Although dnf allows using user-friendly group names (e.g., "Development Tools") for commands like install or info, it is often more reliable and unambiguous to use the internal group ID (e.g., "development-tools"). Group IDs are unique and stable, making them preferable for scripting or when dealing with groups whose names might contain spaces or special characters. Group IDs can be discovered using the command:
dnf group list id
HISTORY
The concept of managing software through logical package groups was a fundamental feature inherited from YUM, the predecessor to DNF. DNF (Dandified YUM) was developed to overcome performance and dependency resolution limitations of YUM, becoming the default package manager for Fedora distributions starting with version 22. The group subcommand in DNF has been a core capability from its inception, providing a more robust, efficient, and reliable mechanism for users to manage collections of packages as logical units.