1

Example file:

/var/lib/dpkg/info/util-linux.prerm

What's the Fedora equivalent of this file? (Not limited to util-linux - generic question for any package.)

Use case: A prerm script is failing. For debugging purposes, I would like to enable xtrace (sh -x).

3

Fedora uses RPMs. Assuming the util-linux RPM is installed on your system, the command to show the pre-removal scriptlet is:

rpm -q --queryformat '%{PREUN}\n' util-linux

You can check if the "util-linx" RPM is installed with this command:

rpm -q util-linux

If you want to show all RPM scriptlets for util-linux, you can use this command:

rpm -q --scripts util-linux

EDIT: Since the pre-removal script failed, it is possible that the RPM did not get installed. In this case, you can view the scriptlet of an uninstalled RPM with this command:

rpm -qp --scripts util-linux

To view all scriptlets for every package that is currently installed on your system:

rpm -qa --scripts
  • But how do I run the scriptlet with debugging enabled? (xtrace, set -x) – adrelanos Jul 6 '15 at 21:44

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.