Pages

Friday, August 24, 2012

Linux rpm commands

Following are the rpm commands I regularly use on RHEL and variants:

CommandDescriptionExample
rpm -qaList all installed rpmsrpm -qa | grep kernel
rpm -qlm <rpm file>
or
rpm -qpl <rpm file>
List the files contained in the .rpm file
rpm -ivh <rpm file> Check for dependency then install rpm
rpm -Uvh <rpm file> Check for dependency then update package
rpm2cpio <rpm file> | cpio -idmv <leave empty for all or specify specific files in the rpm> Extract files contained in the rpm (without install) into current directory