When to use dnf
Use dnf on supported RPM-based distributions to inspect and install repository packages. Review repository trust, dependencies and the proposed transaction before making changes to a working server.
Syntax
dnf [PARAMETERS] ACTION [PACKAGE...]Square brackets mark optional arguments; an ellipsis means repetition. Replace example file names, user names and server addresses with your own values.
Common options and arguments
Usage examples
Find package
dnf search tmuxRepository metadata is searched for relevant package matches.
View details
dnf info tmuxPackage details are displayed without installation.
Install the selected package
sudo dnf install tmuxThe selected package and required dependencies are proposed for installation.
Notes and limitations
- Used in Fedora and a number of RHEL compatible systems; DNF 4 and DNF 5 differ in details.
- Before confirming the transaction, check the packages being installed, updated, and removed.
Common questions and troubleshooting
Why does dnf not exist on my server?
Package managers depend on distribution and release. Identify the operating system before choosing an installation command.
Why is a transaction blocked by dependencies?
Installed versions, enabled repositories and policy can conflict. Investigate the reported constraints rather than forcing removal of unrelated packages.
Further help
Options vary by version and distribution. Check the installed documentation with this command: man dnf.