Check optional scripts in rpm file

:heavy_exclamation_mark: This post is older than a year. Consider some information might not be accurate anymore. :heavy_exclamation_mark:

RPM allows optional scripts to be executed within the install and remove operation.

This involves the events

  • pre-install
  • post-install
  • pre-uninstall
  • post-uninstall

To check the script contents:

rpm -qlp test.x86.rpm --scripts > scripts.out
# to search for foo in scripts
grep "foo" scripts.out

The options are:

  • {-q | --query}
  • {-l | --list} = query option, list files in package
  • {-p | --package} URLFILE = query option, query an (uninstalled) package URLFILE.
  • --scripts = query option, list the package specific scriptlet(s) that are used as part of the installation and uninstallation processes.
Please remember the terms for blog comments.