Fedora users still install packages with the familiar dnf command. On current Fedora releases, that command is backed by DNF5, so older DNF4 examples can break even though the command name did not change.
These Fedora dnf install examples focus on package transactions: installing packages, previewing changes, using local RPM files, handling groups, managing repository helpers, and replacing old forms such as localinstall, groupinstall, and config-manager --add-repo.
Install Packages with dnf on Fedora
The basic Fedora terminal install command is short. Replace package-name with the package you want to install:
sudo dnf install package-name
Package installs need administrative access. If your account cannot run
sudoyet, add a user to sudoers on Fedora before continuing, then return to thesednfcommands.
For example, install Vim with this command:
sudo dnf install vim
The current Fedora dnf command resolves dependencies, shows the transaction summary, and asks for confirmation before it changes the system.
Preview a dnf Install Transaction
Use --assumeno when you want to see what dnf would install without actually installing anything:
sudo dnf install vim --assumeno
Relevant output includes the package list and transaction summary. Version numbers and sizes can change after updates:
Package Arch Version Repository Size Installing: vim-enhanced x86_64 2:9.2.597-1.fc44 updates 4.5 MiB Installing dependencies: gpm-libs x86_64 0:1.20.7-53.fc44 fedora 31.5 KiB vim-common x86_64 2:9.2.597-1.fc44 updates 38.3 MiB vim-filesystem noarch 2:9.2.597-1.fc44 updates 40.0 B xxd x86_64 2:9.2.597-1.fc44 updates 33.3 KiB Transaction Summary: Installing: 5 packages
Install Multiple Packages at Once
The dnf command can install several packages in one transaction, which lets it resolve shared dependencies only once:
sudo dnf install vim nano htop
If one package in the list is already installed, dnf reports that state and continues with the missing packages.
Install Without a Confirmation Prompt
The -y option automatically answers yes to prompts. Use it for scripts or repeatable setup commands only when you already know the transaction is safe:
sudo dnf install -y vim
When a command can remove packages, replace packages, or pull in a large dependency set, preview the transaction first or omit
-yso you can review the prompt.
Reinstall a Fedora Package with dnf
Use dnf reinstall when package-owned files are missing or damaged but you want to keep the same package installed:
sudo dnf reinstall vim
Reinstalling restores files owned by the RPM package. It does not reset user configuration files in your home directory.
Install a Local RPM File with dnf
Current Fedora dnf does not need the old localinstall subcommand. Use the normal install command with a relative or absolute RPM path; installing a suggested dnf5-command(localinstall) provider is not the fix for local RPM files.
sudo dnf install ./package-name.rpm
The official install-command reference treats local RPM paths as normal install arguments, so this path also lets dnf resolve dependencies from enabled repositories.
Remove Packages Installed During Testing
If you installed packages only to practice dnf commands, remove them with dnf remove. Review the transaction before confirming because Fedora may also remove dependencies that are no longer needed:
sudo dnf remove vim nano htop
To review orphaned dependencies separately, run autoremove and inspect the proposed removal list before accepting it:
sudo dnf autoremove
Verify Fedora dnf and Refresh Repositories
Before you troubleshoot a package command, confirm that Fedora’s dnf command is using the current DNF5 backend and that repository metadata is fresh.
Confirm dnf Uses the Current Backend
Check the dnf backend version from the same terminal where you plan to install packages:
dnf --version
A Fedora 44 system reports the DNF5 backend behind the dnf command. Exact patch versions can change after updates:
dnf5 version 5.4.2.1 dnf5 plugin API version 2.0 libdnf5 version 5.4.2.1 libdnf5 plugin API version 2.2
If the version starts with 4., do not apply current Fedora dnf examples to that system. DNF4 plugin packages and repository-management syntax can differ, so use instructions written for that distribution.
Update Fedora Package Metadata
Refresh repository metadata and apply pending updates before a larger install session:
sudo dnf upgrade --refresh
The --refresh option forces dnf to reload repository metadata before it calculates the upgrade. If metadata downloads or package transactions feel slow, the DNF speed tuning guide for Fedora covers mirror and parallel-download settings. For hands-off update scheduling, use the separate guide to install dnf-automatic on Fedora.
Find Fedora Package Names with dnf
Fedora package installs depend on the Fedora package name, not always the upstream project name. Search first when you are not sure which package owns a command or application.
Search for Packages by Keyword
Search package names and summaries with dnf search:
dnf search editor
Relevant output includes matching package names and descriptions:
Matched fields: name, summary ants-level-editor.x86_64 Ants level editor chewing-editor.x86_64 Cross platform chewing user phrase editor ckeditor.noarch WYSIWYG text editor to be used inside web pages ckeditor-samples.noarch Samples for ckeditor cpeditor.x86_64 The Missing Editor for Competitive Programmers crossword-editor.x86_64 Crossword puzzle editor
The
dnf search,dnf info,dnf provides, anddnf repo listcommands read package metadata and do not needsudo.
Find Which Fedora Package Provides a Command
If a command is missing, use dnf provides to find the package that contains it. This example checks the package that provides semanage:
dnf provides '*/semanage'
Relevant output includes the package name and repository. If the package is already installed, dnf can also show an @System entry before the repository candidate:
policycoreutils-python-utils-3.10-4.fc44.noarch : SELinux policy core python utilities Repo : @System Matched From : Provide : policycoreutils-python-utils = 3.10-4.fc44 policycoreutils-python-utils-3.10-4.fc44.noarch : SELinux policy core python utilities Repo : updates Matched From : Provide : policycoreutils-python-utils = 3.10-4.fc44
Use the package name from the first field when it matches the command you need:
sudo dnf install policycoreutils-python-utils
View Package Details Before Installing
Use dnf info when you want the version, repository, installed size, source RPM, and package summary before installing:
dnf info vim-enhanced
Example output on Fedora 44 includes:
Available packages Name : vim-enhanced Epoch : 2 Version : 9.2.597 Release : 1.fc44 Architecture : x86_64 Download size : 2.1 MiB Installed size : 4.5 MiB Source : vim-9.2.597-1.fc44.src.rpm Repository : updates Summary : A version of the VIM editor which includes recent enhancements
Use dnf Install Options Safely
Install options change how dnf handles dependency resolution, downloads, and transaction prompts. Use the smallest option that solves the problem you are facing.
| Option | Use Case | What to Watch |
|---|---|---|
--assumeno | Preview a transaction without changing packages. | Good for checking dependency changes before an install. |
-y | Automatically confirm prompts. | Use only after you trust the transaction summary. |
--downloadonly | Download packages without installing them. | Useful for staging packages while keeping the system unchanged. |
--offline | Store a transaction for the next offline reboot. | Requires dnf offline reboot to start the stored transaction. |
--skip-unavailable | Continue when one requested package is not available. | Best for optional package lists, not required dependencies. |
--skip-broken | Skip packages with dependency problems. | Review what was skipped so you do not miss required software. |
--allowerasing | Allow package removals to resolve conflicts. | Read the removal list before confirming. |
Download Fedora Packages Without Installing
Use --downloadonly when you want dnf to fetch packages and dependencies without applying the transaction:
sudo dnf install vim --downloadonly
This is useful for preparation work, but it does not install the package. Run the normal install command later when you are ready.
Store a dnf Install for Offline Reboot
The --offline option stores the install transaction. First, prepare the transaction and review the package summary before you confirm:
sudo dnf install vim --offline
When you are ready to reboot and run the stored transaction, start the offline operation:
sudo dnf offline reboot
The dnf offline subcommand also includes status, log, and clean actions for checking or removing stored offline transactions.
Package --offline transactions stay inside the current Fedora release. A full version jump uses the release-upgrade workflow instead; use the Fedora release upgrade guide when moving from one Fedora release to another.
Resolve Dependency Problems with dnf
If optional packages are missing from enabled repositories, --skip-unavailable lets dnf continue with the available package names:
sudo dnf install vim nano optional-package --skip-unavailable
If dependency solving fails for one package, --skip-broken can skip that package and continue with the rest:
sudo dnf install vim nano htop --skip-broken
Use these options for optional batches, not for core packages where a skipped item would leave the system incomplete.
Allow dnf to Replace Conflicting Packages
When a new package conflicts with an installed one, --allowerasing lets dnf propose removing the blocking package:
sudo dnf install package-name --allowerasing
The transaction summary shows any packages Fedora plans to remove before it asks for confirmation. Cancel the transaction if the removal list includes software you still need.
Install Package Groups with dnf
Fedora package groups bundle related packages for a task, such as development tools, desktop environments, or multimedia support. Current dnf handles groups through the group subcommand.
List Fedora Package Groups
List available and installed groups with this command:
dnf group list
Relevant output includes group IDs, names, and whether the group is already installed:
ID Name Installed kde-software-development KDE Software Development no libreoffice LibreOffice yes network-server Network Servers no rpm-development-tools RPM Development Tools no security-lab Security Lab no sound-and-video Sound and Video no
For deeper group management, including group information and optional package handling, use the dedicated Fedora group-command guide.
Inspect a Fedora Package Group
Check a group before installing it so you can see its mandatory, default, and optional packages:
dnf group info development-tools
Relevant output includes:
Id : development-tools
Name : Development Tools
Description : These tools include general development tools such as git and CVS.
Installed : no
Repositories : fedora, updates
Mandatory packages : gettext
Default packages : diffstat
: doxygen
: git
: patch
: patchutils
: subversion
: systemtap
Install a Fedora Package Group
Install a group by ID for repeatable commands:
sudo dnf group install development-tools
You can also use the quoted group name when that is easier to read:
sudo dnf group install "Development Tools"
Manage Fedora Repositories with dnf
Fedora includes its standard repositories by default. Third-party software may provide a .repo file, which dnf can add through the config-manager plugin.
Confirm the dnf config-manager Plugin
Check the actual subcommand before adding repositories; minimal Fedora installs can lack the plugin even when older guides mention DNF4 packages:
dnf config-manager --help
If dnf says the command is provided by dnf5-command(config-manager), install that virtual provider:
sudo dnf install 'dnf5-command(config-manager)'
Fedora resolves that provider through current dnf plugin packages. Do not use dnf-plugins-core as the Fedora fix; it belongs to older DNF4-era instructions and does not prove the current subcommand is available.
Add a Repository File with dnf
Add a repository from a vendor-provided .repo file URL with addrepo:
sudo dnf config-manager addrepo --from-repofile=https://example.com/repo.repo
The older --add-repo option is a DNF4 form. On current Fedora it fails with an unknown-argument error, so translate older instructions to addrepo --from-repofile=.
Enable or Disable Fedora Repositories
List all configured repositories first:
dnf repo list --all
Then enable or disable a repository with setopt:
sudo dnf config-manager setopt repository-id.enabled=1
sudo dnf config-manager setopt repository-id.enabled=0
Replace repository-id with the ID from dnf repo list --all.
Current Fedora stores these repository state changes as overrides under /etc/dnf/repos.override.d/ instead of rewriting the original .repo file. Remove an article-created override with unsetopt when you no longer need it:
sudo dnf config-manager unsetopt repository-id.enabled
Troubleshoot dnf Install Problems
Most Fedora dnf install problems come from a wrong package name, a disabled repository, an old command form, or a local RPM that does not meet the current verification requirements.
Package Name Not Found
A missing or incorrect package name produces an error like this:
Reproduce the check safely with a no-change preview:
sudo dnf install definitely-not-a-package --assumeno
Failed to resolve the transaction: No match for argument: definitely-not-a-package You can try to add to command line: --skip-unavailable to skip unavailable packages
Refresh metadata, search for the package name, and check whether the package lives in a disabled repository:
sudo dnf makecache --refresh
dnf search keyword
dnf repo list --all
After correcting the package name or enabling the needed repository, preview the install again before applying it:
sudo dnf install corrected-package-name --assumeno
If the package is optional in your workflow, rerun the original install with --skip-unavailable. If the package is required, find the correct package or repository before continuing.
Old localinstall Command Fails
Current Fedora dnf does not include a localinstall command. If you run the old command form, the error reports the unknown argument:
sudo dnf localinstall ./package-name.rpm
Unknown argument "localinstall" for command "dnf5". Add "--help" for more information about the arguments. It could be a command provided by a plugin, try: dnf5 install 'dnf5-command(localinstall)'
Do not install the suggested provider for this case. Current Fedora already accepts local RPM paths through dnf install:
sudo dnf install ./package-name.rpm
Old groupinstall Command Fails
Current Fedora group transactions use dnf group install, not the old one-word alias. The stale command usually looks like this:
sudo dnf groupinstall development-tools
Unknown argument "groupinstall" for command "dnf5". Add "--help" for more information about the arguments. It could be a command provided by a plugin, try: dnf5 install 'dnf5-command(groupinstall)'
Do not install the suggested provider for this case. Rewrite the command with the group subcommand:
sudo dnf group install development-tools
Use the group ID from dnf group list when you need repeatable commands.
config-manager Command Is Missing from dnf
Confirm the missing subcommand from the same terminal:
dnf config-manager --help
If dnf suggests dnf5-command(config-manager), install that virtual provider and retest the subcommand:
sudo dnf install 'dnf5-command(config-manager)'
dnf config-manager --help
If you are following instructions for another RPM-based distribution, verify whether its dnf command is DNF5-backed before applying this Fedora command. DNF4 systems need their own config-manager package and syntax.
Old config-manager Options Fail
DNF4-style options such as --add-repo, --set-enabled, and --set-disabled are not current Fedora dnf syntax. The error usually names the old option as unknown:
sudo dnf config-manager --add-repo https://example.com/repo.repo
Unknown argument "--add-repo" for command "config-manager". Add "--help" for more information about the arguments.
Use current dnf subcommands and repository-option overrides instead:
sudo dnf config-manager addrepo --from-repofile=https://example.com/repo.repo
sudo dnf config-manager setopt repository-id.enabled=1
Local RPM Fails with Missing Digest Metadata
Some older community RPMs do not contain the digest metadata that current Fedora package transactions expect. The failure usually looks like this:
Transaction failed: Rpm transaction failed. Warning: skipped OpenPGP checks for 1 package from repository: @commandline - package example-package-1.0-1.noarch does not verify: no digest
Only bypass digest checks for a trusted RPM from a source you deliberately chose. Do not use this workaround for Fedora repository packages or vendor repositories that already publish signed packages.
Inspect the file before using a bypass so you know which package name you are installing and whether RPM can read its signature or digest data:
rpm -K package-name.rpm
rpm -qp --qf '%{NAME} %{VERSION}-%{RELEASE} %{ARCH}\n' package-name.rpm
Only continue with direct rpm when the file is trusted and no maintained repository or fixed RPM is available. Verify the package by installed name afterward:
sudo rpm -ivh --nodigest --nofiledigest package-name.rpm
rpm -q package-name
Dependency Conflicts Block the Transaction
When dnf cannot solve dependencies, read the package names in the conflict message before choosing a fix. For optional package batches, retry with --skip-broken. For a real package replacement, preview --allowerasing first:
sudo dnf install package-name --allowerasing --assumeno
If the preview removes packages you still need, cancel the transaction and resolve the repository or package conflict manually.
Conclusion
Fedora package installs are easier to keep predictable when the dnf syntax matches the current backend: preview unclear transactions, use normal dnf install for local RPM files, route groups through dnf group install, and translate old repository examples before they fail. Use the release-upgrade workflow only when changing Fedora versions, not for normal package installs.


Formatting tips for your comment
You can use basic HTML to format your comment. Useful tags currently allowed in published comments:
<code>command</code>command<strong>bold</strong><em>italic</em><a href="https://example.com">link</a><blockquote>quote</blockquote>