Skip to content

Packages

dnf or yum is designed for managing RPM-based software installation and updates. The dnf command allows you to install, update, remove, and get information about software packages and their dependencies.

Use list and search.

dnf list 'tree'
dnf search all 'web server'

Detailed information about a package can be obtained with the info option.

info httpd

Use the provides option to establish what package provides a familiar tool or program.

dnf provides */semanage
````

Install packages using the `install` option and with the `-y` to bypass any prompts. 

```text
dnf install policycoreutils-python-utils -y

Package groups can be listed and installed too.

dnf group list
dnf group install "Development Tools"

Using dnf history packages can be removed or undone.

dnf history
dnf history undo 8

To see all available repositories use the dnf repolist all command. Found in the yum-utils package, yum-config-manager can be used to enable or disable repositories.

dnf install yum-utils
yum-config-manager --enable ansible-2.8-for-rhel-8-x86_64-rpms

Non-Red Hat sources provide software through third-party repositories. Enable support for a new third-party repository, create a file in the /etc/yum.repos.d/ directory. Repository configuration files must end with a .repo extension.

[EPEL]
name=EPEL 8
baseurl=http://dl.fedoraproject.org/pub/epel/8/x86_64/
enabled=1
gpgcheck=0

Summary

Use the rpm command to query a local database to provide information about the contents of installed packages.

Use the dnf or yum powerful command-line tools to install, update, remove, and query software packages.

Command References:

dnf, yum, yum-config-manager and yum.conf.