Bug 1003598 - RFE: allow to ignore %preun failures
RFE: allow to ignore %preun failures
Product: Fedora
Classification: Fedora
Component: dnf (Show other bugs)
Unspecified Unspecified
low Severity low
: ---
: ---
Assigned To: packaging-team-maint
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2013-09-02 09:05 EDT by Miroslav Suchý
Modified: 2013-09-09 09:34 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-09-09 09:34:28 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Miroslav Suchý 2013-09-02 09:05:43 EDT
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:
Comment 1 Ales Kozumplik 2013-09-03 04:26:37 EDT
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 04:46:11 EDT
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 04:59:17 EDT
%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 09:34:28 EDT
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

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