How to Use DNF Groups to Install Software Collections

DNF groups let you install curated collections of related packages in a single command, making it easy to set up full environments like a development toolchain or web server stack.

You just installed a fresh Fedora system

You need a complete development environment, but typing sudo dnf install gcc make gdb git cmake feels tedious. You know there has to be a better way. DNF groups exist for exactly this moment. They bundle related packages under a single name so you can pull in a complete stack without tracking down individual dependencies.

What is actually happening

Think of a DNF group like a pre-assembled toolbox. Instead of buying a hammer, a screwdriver, and a tape measure separately, you buy the carpentry kit. Under the hood, Fedora maintains metadata files that define three tiers of packages: mandatory, default, and optional. Mandatory packages are the core. The system refuses to install the group without them. Default packages are recommended additions that install automatically. Optional packages sit on the shelf until you explicitly ask for them.

This tiered structure keeps base installations lean while giving you a clear path to expand when your workload changes. The metadata lives in the repository cache, not on your disk. When you run a group command, DNF fetches the latest group definitions, resolves the dependency tree, and stages a single transaction. You get atomic installs and atomic removals. The package manager tracks which packages came from a group and which you added manually. That tracking prevents accidental removals when you clean up later.

Read the metadata before you install. Blindly pulling groups is how you fill a 500 gigabyte drive with unused libraries.

The fix

Here is how to see what collections are available in your configured repositories.

# Show all available groups, including those already installed
sudo dnf group list
# Reveal hidden groups that Fedora keeps out of the default view
sudo dnf group list --hidden
# Pipe through grep to filter by a specific keyword like development
dnf group list | grep -i develop

Before you commit to an installation, check the exact package breakdown to avoid pulling in bloat you do not need.

# Request the full metadata for the Development Tools group
sudo dnf group info "Development Tools"
# The output separates packages into mandatory, default, and optional tiers
# Read the mandatory list first to understand the core footprint

Use the groupinstall command to pull in the mandatory and default tiers in a single transaction.

# Install the complete development stack with one command
sudo dnf groupinstall "Development Tools"
# DNF resolves all dependencies and stages the transaction
# Press y to confirm and watch the download progress

The default installation skips optional packages to save disk space. You can force them in when your workflow demands them.

# Override the default behavior to include optional packages
sudo dnf groupinstall "Development Tools" --setopt=group_package_types=mandatory,default,optional
# The setopt flag temporarily changes the group resolution rules
# DNF will now pull every package listed in the group metadata

Sometimes a group contains a service or database you already run elsewhere. Exclude it to prevent conflicts.

# Install the server stack but skip the MariaDB server package
sudo dnf groupinstall "Server" --exclude=mariadb-server
# The exclude flag tells DNF to ignore that specific package
# The rest of the group installs normally without breaking dependencies

When a project ends, remove the entire collection to clean up unused binaries and libraries.

# Uninstall the web server group and its dependencies
sudo dnf groupremove "Web Server"
# DNF calculates which packages are no longer required
# Review the removal list carefully before confirming

Run the transaction from a terminal, not a GUI. The command line shows dependency resolution clearly.

Verify it worked

Confirm the group registered correctly in the package database.

# List only the groups that are currently marked as installed
sudo dnf group list --installed
# The output shows group names followed by their status
# Match the name against your installation command to verify success

Check the installed list immediately. Package managers do not undo mistakes automatically.

Common pitfalls and what the error looks like

The most frequent error is a missing group name. DNF will refuse to proceed and print Error: Group 'X' does not exist. Group names are case sensitive and often contain spaces. Always wrap them in quotes. If you are unsure of the exact name, run dnf group list and copy the string exactly.

Manual installs break group tracking. If you install gcc manually before installing the Development Tools group, DNF marks gcc as user-requested. When you later run sudo dnf groupremove "Development Tools", DNF will leave gcc behind because it thinks you want to keep it. This drift accumulates over months. Trust the package manager. Let DNF track ownership.

Conflicts appear when two groups try to provide the same binary. You will see Error: Transaction test error: package X conflicts with Y. The conflict is intentional. Fedora splits desktop environments and server stacks to avoid pulling in competing services. Read the next paragraph before forcing. Check which group provides the conflicting package with dnf repoquery --whatprovides <package>. Remove the conflicting group first, then install the new one.

Fedora is transitioning to dnf5. The preview version handles groups differently under the hood but keeps the same CLI syntax. If you enable the preview repository, group commands still work. The metadata format shifts to a more efficient structure, but your daily workflow remains identical. Keep dnf upgrade --refresh as your weekly maintenance command. It forces a cache refresh and pulls in group metadata updates alongside regular package updates.

Config files in /etc/ are user modified. Files in /usr/lib/ ship with the package. Edit /etc/. Never edit /usr/lib/. Group installs drop configuration templates in /etc/. If you modify a file in /usr/lib/, the next group update will overwrite your changes.

Let DNF track ownership. Manual installs break group removals.

When to use this vs alternatives

Use DNF groups when you need a complete, curated stack like a desktop environment or development toolchain. Use individual package installs when you only need one or two binaries and want to keep the system lean. Use COPR repositories when the official Fedora packages are too old or missing a specific feature. Use flatpak or container images when you need isolated runtimes that do not interfere with the host system. Stick to the default repositories for production servers where stability and auditability matter more than cutting-edge versions.

Pick the right tool for the job. Mixing installation methods creates a maintenance nightmare.

Where to go next