Short Tip: Extract pre/post-install scripts from a rpm

shell.png
Once in a while it is necessary to have a look at the content of a binary rpm. However, this might not be enough: some packages come along with rather important and heavy pre/post-install scripts, and in security sensitive/productive systems it might be sensible to check these if you install 3rd party/external rpms.

In contrast to the binary extraction via cpio the scripts can be displayed with rpm itself:

rpm -qp --scripts my_package.rpm > ListOfScripts

Just in case you wonder why I only published short tips the last posts: I simply learn quite a lot these days in my new job, and it’s hard to remember all th good tips and tricks. I need to write them down somewhere, and the best place to do so for me is my blog 😉

Advertisements

3 thoughts on “Short Tip: Extract pre/post-install scripts from a rpm”

  1. An alternative method is to use Midnight Commander that creates a nice virtual filesystem when you press enter on any rpm. From there you have access to descriptions, contents and also the scripts. These can be easily copied as separate files to another location.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s