rpm dependency resolution with 'Provides'/'Requires' statements in spec file not working as expected

Solution Verified - Updated -

Issue

We build a RPM package with rpmbuild the following is a part of the used SPEC file:

Name: example
Version: 1
Release: 2{?dist}
Provides: example
...

A second package we build should have a dependency on a specific version/revision of the first package. The SPEC file contains also this:

Name: foobar
Version: 1
Release: 2{?dist}
Requires: example = %{version}-%{release}
...

When using the resulting RPM files the package foobar accepts any version of the installed package example instead of requiring this specific version/release combination, why is that?

Environment

  • Red Hat Enterprise Linux (RHEL), several versions

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.