Strangely enough there is no way to directly extract the contents of an .rpm package using the rpm (RPM Package Manager) tool. This feature can come in handy for example if you need to access a single file in a package but you don’t want to install it on your system. Fortunately there is a simple hack that you can use to make this work.
To do this use the rpm2cpio tool to convert an .rpm file to a cpio archive then pipe it to cpio command to extract it.
Here is an example:
$ rpm2cpio rpm-package.rpm | cpio -idmv
The options explained:
i – Extract the archive
d – Create leading directories where needed
m – Retain previous file modification times when creating files
v – List the files processed, be verbose