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?

  • 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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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