There is an option in the .rpm file to check if the current installation is installed with the first version in the current system
i.e. %pre and %post scripts will be passed an argument equal to 1 *, and also when uninstalling the latest version of %preun and %postun scripts will be passed an argument equal to 0 *. ref:
Is there an equivalent thing when installing .deb files? This seems rather obscure, and my searches do not change anything.
source share