Description of problem: On my systems RPM ignores the dependency on perl-macros from perl. When using dnf, the dependency is recognised. Version-Release number of selected component (if applicable): rpm-4.13.0-0.rc1.7.fc23.x86_64 How reproducible: Every time. Steps to Reproduce: 1. rpm --test -e perl-macros Actual results: No objections. Expected results: RPM should say that the perl package depends on perl-macros. Additional info: To further illustrate, see the below commands: [göran@freddi Hämtat]$ sudo rpm --rebuilddb [sudo] password for root: [göran@freddi Hämtat]$ cd [göran@freddi ~]$ rpm -q perl-macros perl-macros-5.22.0-349.fc23.x86_64 [göran@freddi ~]$ rpm -q --whatprovides perl-macros perl-macros-5.22.0-349.fc23.x86_64 [göran@freddi ~]$ rpm -q --whatrequires perl-macros no package requires perl-macros [göran@freddi ~]$ rpm -q --requires perl | grep macros perl-macros [göran@freddi ~]$ rpm --test -e perl-macros [göran@freddi ~]$ Actually running the last command, without "--test", also succeeds. But trying to do "dnf remove perl-macros" attempts to remove more than 2000 packages. And that appears more correct, given that perl depends on perl-macros.
This is expected rpm behaviour. Have a look at perl.spec: 212 Requires(post): perl-macros From rpm documentation: Context Marked Dependencies Recent versions of RPM support context marked dependencies. This is a special type of a dependency that applies only in a specified context. Using this feature, one can specify dependencies for pre- and post(un)install scriptlets, ie. the context of a dependency is the execution time of the specified scriptlet. The syntax for specifying these dependencies is: Requires(X): foo Here, X can be one of pre, post, preun, or postun, which tells RPM that the package depends on package foo for running the corresponding %pre, %post, %preun, or %postun script. In practice, RPM enforces the above dependencies until the specified script has been run, not at that time. In other words, it will allow erasing a dependency that was marked for eg. the %post script for an already installed package, but will not allow erasing one that is required for a %postun script for such a package. This is to reduce confusion; it would be somewhat odd if RPM told one to install a package in order to get another one erased. Why does dnf attempt to remove more than 2000 packages is another question. I tried it with yum too and yum also removed only one package.
This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component.
I think this has been fixed already somewhere in libsolv/dnf/whatever.
It works for me too with the current dnf. It only removes one package.