Bug 1710691 - Package gets removed on failed update via dnf
Summary: Package gets removed on failed update via dnf
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: rpm
Version: 7.0
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Panu Matilainen
QA Contact: Luca Berton
Depends On:
TreeView+ depends on / blocked
Reported: 2019-05-16 05:43 UTC by Panu Matilainen
Modified: 2020-05-30 01:45 UTC (History)
2 users (show)

Fixed In Version: rpm-4.11.3-43.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2020-03-31 20:01:53 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:1114 0 None None None 2020-03-31 20:02:04 UTC

Description Panu Matilainen 2019-05-16 05:43:12 UTC
This bug was initially created as a copy of Bug #1710346

I am copying this bug because: 

AIUI yum doesn't exhibit this problem, but the bug exists in rpm 4.11 nevertheless and the dnf tech-preview (or something like that) in RHEL-7 extras is expected to be affected. Because dnf is not the default in RHEL-7, the priority is lower than in RHEL-8.

Description of problem:

When updating packages with dnf, if install of the newer package fails the package gets entirely removed as the cleanup stage runs despite the failure.

Version-Release number of selected component (if applicable):
All versions of rpm up to 4.14.2

How reproducible:

Steps to Reproduce:
1. mount an iso image on /mnt
2. update/downgrade filesystem package

Actual results:
filesystem package gets removed completely

Expected results:
filesystem package stays in the original version

Additional info:
Here's a replay of it on Fedora, but equally applicable to RHEL and should be reproducable with just %pre scriptlet failure as well.

[root@sopuli ~]# rpm -q filesystem
[root@sopuli ~]# mount -o loop ~pmatilai/iso/Fedora-Server-dvd-x86_64-28-1.1.iso /mnt/
mount: /mnt: WARNING: device write-protected, mounted read-only.
[root@sopuli ~]# dnf -y -q update filesystem-3.10-1.fc30.x86_64.rpm 
Error unpacking rpm package filesystem-3.10-1.fc30.x86_64
Error: Transaction failed
[root@sopuli ~]# rpm -q filesystem
package filesystem is not installed
[root@sopuli ~]#

The reason for this is somewhat unexpected (but legitimate) API use by dnf, so it cannot be reproduced by rpm itself. The bug is certainly in rpm though.

Comment 8 errata-xmlrpc 2020-03-31 20:01:53 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Comment 9 Fedora Update System 2020-05-30 01:45:17 UTC
FEDORA-EPEL-2020-3ef1e07e82 has been pushed to the Fedora EPEL 7 stable repository.
If problem still persists, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.