Passing user defined argument to RPM is possible while installing?

sakthi picture sakthi · Jun 26, 2012 · Viewed 11.9k times · Source

Passing User defined argument to RPM is possible while installing?.

for example:

~>rpm -i sample.rpm -license_path=/path/

or

~>rpm -i -license_path=/path/ sample.rpm

or

~>rpm -i -somearg sample.rpm

-Sakthi

Answer

pwan picture pwan · Jun 26, 2012

RPMs aren't meant to take user defined arguments.

See RPM - Install time parameters

Another similar question is at https://superuser.com/questions/408852/is-it-possible-to-get-users-input-during-installation-of-rpm

One workaround is to have the rpm's postinstall script ask for input from stdin, in which case you can pass in the answers by redirecting stdio from a file or here document.

>rpm -i sample.rpm <<__NOT_RECOMMENDED__
somearg
__NOT_RECOMMENDED__