List Contents Of An RPM Package

Often when building RedHat RPM packages I want to make sure that the package built correctly and all the files are present before I actually install the RPM, but I do keep forgetting the command to do this, so here it is for prosperity!

rpm -qlp

e.g.

root@build:/usr/src/redhat/SPECS# rpm -qlp ../RPMS/noarch/servicemap-0.16-1.noarch.rpm
/var/www/html/servicemap
/var/www/html/servicemap/amq.png
/var/www/html/servicemap/amqfail.png
/var/www/html/servicemap/amqreportingprov1prov1.png
/var/www/html/servicemap/amqreportingprov1prov2.png
/var/www/html/servicemap/amqreportingprov2prov1.png
/var/www/html/servicemap/amqreportingprov2prov2.png
/var/www/html/servicemap/amqsdrprov1prov1.png
/var/www/html/servicemap/amqsdrprov1prov2.png
/var/www/html/servicemap/amqsdrprov2prov1.png
/var/www/html/servicemap/amqsdrprov2prov2.png
/var/www/html/servicemap/amqslee1fail.png
/var/www/html/servicemap/amqslee1prov1.png
/var/www/html/servicemap/amqslee1prov2.png
/var/www/html/servicemap/amqslee2fail.png
/var/www/html/servicemap/amqslee2prov1.png
/var/www/html/servicemap/amqslee2prov2.png
/var/www/html/servicemap/amqvqeprov1prov1.png
/var/www/html/servicemap/amqvqeprov1prov2.png
/var/www/html/servicemap/amqvqeprov2prov1.png
/var/www/html/servicemap/amqvqeprov2prov2.png
/var/www/html/servicemap/amqwebserviceprov1prov1.png
/var/www/html/servicemap/amqwebserviceprov1prov2.png
/var/www/html/servicemap/amqwebserviceprov2prov1.png
/var/www/html/servicemap/amqwebserviceprov2prov2.png
/var/www/html/servicemap/checks.php
/var/www/html/servicemap/config.php
/var/www/html/servicemap/hash.png
/var/www/html/servicemap/index.php
/var/www/html/servicemap/nagios.php
/var/www/html/servicemap/script.php
/var/www/html/servicemap/sleevipactivenotok.png
/var/www/html/servicemap/style.php
/var/www/html/servicemap/ttprov1.png
/var/www/html/servicemap/ttprov1prov2.png
/var/www/html/servicemap/ttprov2.png
/var/www/html/servicemap/ttprov2prov1.png
/var/www/html/servicemap/ttprovfail.png
/var/www/html/servicemap/ttslee1.png
/var/www/html/servicemap/ttslee1slee2.png
/var/www/html/servicemap/ttslee2.png
/var/www/html/servicemap/ttsleefail.png
/var/www/html/servicemap/ttvipactivenotok.png
/var/www/html/servicemap/ttvipactiveok.png

Fedora Linux O’Reilly’s Fedora Linux covers everything you need to know about dealing with Redhat systems and is a recommended read for anyone who wants to seriously get in to Redhat administration.

About rus

Arrogant, narcissistic and imperatively logical. I first started coding in the mid 80s on an Amstrad 6128, entering games found in the back of Amstrad Action.After watching Hackers and falling in love with Angelina Jolie I installed Slackware 2.0 on a P200 in 1997and spent the next 6-7 years studying computery things at various colleges and universities.Several years later I can now be found in an office premises by day sat in front of a Macbook, using a Windows VM to manage Linux servers, or in a field by night, fire dancing and holding pyrotechnics casually in my hands whilst they explode.

  • Mike M

    Handy to note that this also works for installed packages without having the RPM file handy:

    rpm -ql

  • Mike M

    That was supposed to say “installed package name” in angle brackets…

banner