Given a file, which package is it in?
# rpm -q -f <file>
Given a package name, which files are related?
# rpm -ql <package>
Given a package name, display package information:
# rpm -qi <package>
Dump all package names:
# rpm -qa | sort | more
Dump all package information:
# rpm -qai
Search uninstalled RPMs for a file:
# ls -1 *.rpm | xargs rpm --query --filesbypkg --package | grep <search_pattern>
Note: The tip above was adapted from the Nov 2008 Linux Journal "Tech Tip" by Dashamir Hoxha on page 31.