Linux Commands / IT Support Guides
Find the RPM package behind a Linux executable
Find which installed RPM package registered a file path.
Environment and inputs: Linux · Bash-compatible shell; package and service names vary by distribution
Understand the problem
Run the check on an RPM-based host. Identify the path you want to look up, such as /usr/bin/bash.
Run the command
Run rpm -qf with the file path. The q selects query mode and f asks RPM for the package associated with the file.
rpm -qf /usr/bin/bash
Read the output
A result beginning with bash- identifies the package. Its version and architecture depend on what is installed on the host.
Choose the next step
If RPM says the file is not owned by any package, verify the path. It could have been installed manually or generated after installation.
Before making changes
Record the installed package identifier in the incident notes. If you also need to check file integrity, use a package verification procedure.