LinuxCommandLibrary

dnf-install

install RPM packages

TLDR

Install packages by name

$ sudo dnf install [package1] [package2]
copy
Install from local file
$ sudo dnf install [path/to/file]
copy
Install from URL
$ sudo dnf install [https://example.com/package.rpm]
copy
Add EPEL repositories
$ sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-[10].noarch.rpm
copy
Add Remi repository
$ sudo dnf install https://rpms.remirepo.net/enterprise/remi-release-[8].rpm
copy

SYNOPSIS

dnf install [options] package...

DESCRIPTION

dnf install is the primary command for installing software packages on Red Hat-based distributions including RHEL, CentOS, Fedora, and AlmaLinux. It handles installation from multiple sources: repository package names, local RPM files, or direct URLs to RPM packages.
The command automatically resolves and installs all required dependencies, downloading them from configured repositories. When installing from URLs, this is commonly used to add third-party repositories like EPEL or RPM Fusion by installing their release packages. The tool verifies package signatures, checks for conflicts, and can handle complex scenarios like replacing packages or allowing erasure of conflicting packages with --allowerasing. Root privileges are required as installation modifies system files.

PARAMETERS

package

Package name, local file path, or URL
-y, --assumeyes
Automatically answer yes to prompts
--allowerasing
Allow erasing conflicting packages
--downloadonly
Download only, don't install

CAVEATS

Requires root privileges. Package names must match repository names exactly. Installing from URLs requires network access.

SEE ALSO

dnf(8), dnf-remove(8), rpm(8)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community