Package / system tool

dnf — RHEL family

dnf is used for package management or system administration in the RHEL family. Consult the distribution manual for release-specific behaviour.

Availability: RHEL, Fedora, Rocky Linux and related distributions; exact package manager depends on release.中文

Syntax

dnf [options] command

Examples

dnf is used for package management or system administration in the RHEL family. Consult the distribution manual for release-specific behaviour.

sudo dnf install <package>

Show command help and options where supported.

dnf --help

Parameters, options and clauses

Option / clauseDescription
install / remove <package>Install or remove packages; inspect dependency changes first.
search <term>Search package names and summaries.
info <package>Display package and repository details.
--refreshRefresh cached metadata before the operation.
-y, --assumeyesAnswer prompts automatically.
Safety note

Review a command and its target before running it. Commands that alter files, services, accounts, disks, permissions or databases may be difficult to reverse. Test in a safe environment and keep backups.

Official reference ↗Back to directory