Bugzilla – Bug 980387
Requires(post,postun) can hinder uninstalls
Last modified: 2016-05-17 16:28:30 UTC
The presence of Requires(preun) and Requires(postun) tags in specfiles mean that, to uninstall a package X, the presence of another provider Y is required - at uninstall time. If Y is not installed during normal system operation, then Y needs to be installed to permit X's removal, which feels backwards to the idea of getting rid of packages. 17:52 < DimStar:#opensuse-factory> there seems also to be a bug in rpm imho: rpm -qR colord | grep systemd => it is listed 4 times... which are the 4 scripts (pre,post,preun,postun).. - all of them stopping an uninstall Indeed, `rpm -e` will error out. `zypper rm`, by its solver nature, will just performing the installation of Y together with the removal of X in one go, though without removing Y afterwards again. Suggestion is therefore to remove all preun/postun requires and make the %preun and %postun scripts deal with absence of programs.
For reference: this discussion came up out of a simple usecase of producing a 'docker image with apache2', where apache2 has the usual %systemd_requires and service handling in post/postun The presence of systemd in such a container is rather useless - but it can't be removed for the dependencies of the scriptlets
For %systemd_requires, there is now bug #980389. This ticket is solely about Requires(preun,postun) specifically. On the matter, the first package with scriptlets that comes to mind is shared-mime-info together with %post /usr/bin/update-mime-database. In a number of places, such as o:F/boo, this has already been protected with [ -x /usr/bin/update-mime-database ].