Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugging RPM scriptlets with -x

Tags:

rpm

Is there a way to get /bin/sh -x style output from RPM while it's running a scriptlet? I would like to debug RPM installations.

like image 499
ldrg Avatar asked Apr 26 '26 16:04

ldrg


2 Answers

You can put set -x at the beginning of any scriptlet. And rpm -ivvh to install it will give you more than you would want to know.

like image 150
Aaron D. Marasco Avatar answered Apr 30 '26 03:04

Aaron D. Marasco


Try putting an exit 1 in %post scriptlet, then run sh -x on the temporary file left when the upgrade fails (after removing the exit from the temp file).

like image 39
Jeff Johnson Avatar answered Apr 30 '26 01:04

Jeff Johnson