Bug 1003598

Summary: RFE: allow to ignore %preun failures
Product: [Fedora] Fedora Reporter: Miroslav Suchý <msuchy>
Component: dnfAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: rawhideCC: akozumpl, packaging-team-maint, pmatilai, pnemade
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-09 13:34:28 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:

Description Miroslav Suchý 2013-09-02 13:05:43 UTC
Description of problem:
If package during upgrade fails in %preun script, then I will and with duplicate packages.
Ie. if I have package foo-1.0, which have typo in %preun script and I'm going to upgrade to foo-2.0, then rpm will install foo-2.0 and then it will try to remove foo-1.0 which will fail. So I will happen to have both version installed.

IMO dnf should detect such errors and in such cases run equivalent of:
  rpm -e foo-1.0 --noscripts
Or at least ask user if he want to do that.

For historic example see:
https://lists.fedoraproject.org/pipermail/devel/2013-July/186910.html

Comment 1 Ales Kozumplik 2013-09-03 08:26:37 UTC
Hi Miroslav and thanks for the report. This both makes and doesn't make sense for DNF: on one hand why should DNF be making any effort to be hiding real and possibly serious packaging problems from the user. On the other hand, as you are pointing out, less experienced user might not even know how to manually remove ailing packages. Let's leave this open for now with the outlook of closing as WONTFIX unless both of the following will happen:

:: there's a nice way to make rpm ignore error in the %preun script after it happens and without restarting transaction (Panu?)
:: no new configuration option has to be introduced for this.

Comment 2 Miroslav Suchý 2013-09-03 08:46:11 UTC
Or even dnf does not need to solve it directly, but just detect that dupes appeared and point user to:
  /usr/bin/package-cleanup --cleandupes 
I just learned about this command yesterday.

Comment 3 Panu Matilainen 2013-09-03 08:59:17 UTC
%pre and %preun errors cannot be wiped under the carpet as they are used to intentionally prevent installation and uninstallation by packages "in the wild". It might not be a particularly good practise, but it is the only means of achieving that.

Comment 4 Ales Kozumplik 2013-09-09 13:34:28 UTC
Closing as NOTABUG per comment 3.

I added a FAQ page explaining to the users how to deal with this[1].

[1] http://akozumpl.github.io/dnf/user_faq.html