I have built an RPM package and to install the package I run
rpm -Uvh --force rpm_package_name.rpm
Is there any command that I can define in spec during rpm build so that it uninstalls the package in single go, just like install works.
NO.
you cannot force in advance how the user will use rpm
, zypper
or yum
to install or uninstall your package.
The question I would ask: how come the user needs to use --force
to uninstall your rpm? In that case I would suggest you to try building an rpm that does not need special flags to get uninstalled.