Check optional scripts in rpm file

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.