Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I executed the following on xyz-3.0.rpm: $ rpm -qi --scripts ~/xyz-3.0.rpm > list

Now here's what list showed: $ cat list

postinstall scriptlet (/bin/sh): 
rm /opt/xyz/config/appkey.cfg

Now I see that the setup script was not added properly, and options are missing. It should have been called with a -i argument.

To fix this, my hunch was to go and search the .spec file which generates this rpm but within the spec file I did not see any setup script being called.

I believe I am looking into the right spec file but I don't see the setup script being called.

Is there a way I can extract the spec file from xyz-3.0.rpm? Or maybe modify the specfile to have setup run with -i argument?

share|improve this question
Is there an error that you're seeing? How do you know the postinstall script is missing? – Andrew M. Jan 30 '12 at 21:12

The command you ran to list the scripts within the xyz RPM was missing the -p or --package option that is needed to query an uninstalled package. The command should have been

rpm -qp --scripts ~/xyz-3.0.rpm > list

Answering your question, it would be possible to extract and modify the spec file from the xyz-3.0.rpm if and only if that rpm contains the spec file.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.