# Package management
DNF/YUM (RHEL/Fedora)
Install, update and remove packages on RHEL, Rocky, AlmaLinux and Fedora with dnf.
The basics
dnf is the successor to yum on modern RHEL-family distros; the yum command still works as an alias on most of them. There's no separate 'update index' step before install — dnf resolves against repo metadata automatically.
bash
sudo dnf install nginx
sudo dnf remove nginx
sudo dnf check-update # list available updates without applying themSearching for a package
search matches names and summaries; info shows full details including the exact version and repo a package comes from.
bash
dnf search redis
dnf info redisEnabling extra repositories
Many useful packages (e.g. nginx's own upstream repo, or EPEL for RHEL-family systems) aren't in the base repos. EPEL is the most common one to add.
bash
sudo dnf install epel-release
sudo dnf install htopCleaning up
autoremove drops orphaned dependency packages; clean all clears cached package data and metadata.
bash
sudo dnf autoremove -y
sudo dnf clean all