Linux Package Management Cheat Sheet/Find package owning a file

Identify which rpm package owns a path.

Section: DNF and Yum for RHEL family

Find package owning a file

bash
bash
rpm -qf /usr/sbin/sshd
Explanation

Useful for auditing binaries and config origins.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing DNF and Yum for RHEL family
Query installed package
Inspect installed rpm metadata.
OpenIn sheetbashsame section
Check available updates
Query repositories for updates.
OpenIn sheetbashsame section
Upgrade packages
Upgrade installed packages to latest versions.
OpenIn sheetbashsame section
Install package
Install packages with dependencies.
OpenIn sheetbashsame section
Remove package
Uninstall packages from the system.
OpenIn sheetbashsame section
Search packages
Search by name or summary.
OpenIn sheetbashsame section