Bug 1693212

Summary: Reinstall with --replacepkgs fails on packages with self-conflicts
Product: Red Hat Enterprise Linux 8 Reporter: Panu Matilainen <pmatilai>
Component: rpmAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED DEFERRED QA Contact: Luca Berton <lberton>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0CC: lberton, mdomonko
Target Milestone: rcKeywords: Triaged
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-06-18 10:33:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Reproducer spec none

Description Panu Matilainen 2019-03-27 11:16:18 UTC
Created attachment 1548507 [details]
Reproducer spec

Description of problem:

Rpm has permitted self-conflicts in packages since version 4.9, but attempting to reinstall such packages with -i --replacepkgs (which yum 3.x uses for the purpose) fails with dependency errors.

Version-Release number of selected component (if applicable):

All current rpm versions (4.9 - 4.14/upstream)

How reproducible:
Always

Steps to Reproduce:
1. rpmbuild -bb self-conflict.spec (see attachment)
2. rpm -i self-conflict-2.0-1.noarch.rpm
3. rpm -i --replacepkgs self-conflict-2.0-1.noarch.rpm

Actual results:
error: Failed dependencies:
	blech conflicts with self-conflict-2.0-1.noarch
	blech conflicts with (installed) self-conflict-2.0-1.noarch

Expected results:
Step 3. succeeds silently

Additional info:
This is is a relatively rare issue, it took eight years for anybody to discover and would be low priority/severity but as this is getting fixed in rhel-7 (via workaround in yum, see bug 1564747) we need it fixed in rhel-8 to avoid creating a regression.

Comment 1 Panu Matilainen 2019-08-30 08:16:10 UTC
For the record, there's now a partial fix for this case now at upstream - it doesn't help with -i --replacepkgs but it does fix the more "common" -U --replacepkgs: https://github.com/rpm-software-management/rpm/pull/770

Comment 5 Panu Matilainen 2020-06-18 10:33:21 UTC
As there's no real pressure to get this fixed, lets just defer it to some possible future date.

The case of installing/upgrading with -U is fixed upstream and Fedora, but backport is on the scary side, and for -i there is no solution which would not involve breaking longstanding rpm principles.