Bug 1071854 - dnf reinstall does not work as expected
Summary: dnf reinstall does not work as expected
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Honza Silhan
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1092830 (view as bug list)
Depends On: 966715
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-03-03 10:23 UTC by Hans de Goede
Modified: 2014-09-23 04:40 UTC (History)
8 users (show)

Fixed In Version: dnf-0.6.1-1.fc21
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-09-23 04:40:13 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
/tmp/dnf-reinstall-0.patch (1.76 KB, patch)
2014-03-04 12:16 UTC, Panu Matilainen
no flags Details | Diff

Description Hans de Goede 2014-03-03 10:23:24 UTC
Hi,

After locally building and installing some packages before submitting them to the buildsys I wanted to reinstall them from the repo once they hit the repo.

So I did:

[hans@shalem ~]$ sudo dnf reinstall gstreamer1-plugins-ugly gstreamer1-plugins-bad-freeworld gstreamer1-libav audacious-plugins-freeworld* mpg123* libmpg123*
Resolving dependencies
--> Starting dependency resolution
--> Finished dependency resolution
Dependencies resolved.
Nothing to do.

Which is not what I expected, yum did do what I wanted:

[hans@shalem ~]$ sudo yum reinstall gstreamer1-plugins-ugly gstreamer1-plugins-bad-freeworld gstreamer1-libav audacious-plugins-freeworld* mpg123* libmpg123*
<snip>
Reinstalling:
 audacious-plugins-freeworld  x86_64 3.4.3-1.fc21  rpmfusion-free-rawhide 7.5 k
 audacious-plugins-freeworld-aac
                              x86_64 3.4.3-1.fc21  rpmfusion-free-rawhide  32 k
 audacious-plugins-freeworld-ffaudio
                              x86_64 3.4.3-1.fc21  rpmfusion-free-rawhide  18 k
 audacious-plugins-freeworld-mms
                              x86_64 3.4.3-1.fc21  rpmfusion-free-rawhide  14 k
 audacious-plugins-freeworld-mp3
                              x86_64 3.4.3-1.fc21  rpmfusion-free-rawhide  16 k
 gstreamer1-libav             x86_64 1.2.3-1.fc21  rpmfusion-free-rawhide 2.8 M
 gstreamer1-plugins-bad-freeworld
                              x86_64 1.2.3-1.fc21  rpmfusion-free-rawhide 157 k
 gstreamer1-plugins-ugly      x86_64 1.2.3-1.fc21  rpmfusion-free-rawhide 245 k
 libmpg123                    x86_64 1.18.1-1.fc21 rpmfusion-free-rawhide 165 k
 libmpg123-devel              x86_64 1.18.1-1.fc21 rpmfusion-free-rawhide 262 k
 mpg123                       x86_64 1.18.1-1.fc21 rpmfusion-free-rawhide 102 k
 mpg123-plugins-pulseaudio    x86_64 1.18.1-1.fc21 rpmfusion-free-rawhide  11 k

Transaction Summary
===========================================================
Reinstall  12 Packages

Regards,

Hans

Comment 1 Parag Nemade 2014-03-04 04:56:49 UTC
To add here my observations,
[parag@f20 ~]$ sudo dnf reinstall yumex
Resolving dependencies
--> Starting dependency resolution
---> Package yumex.noarch 3.0.14-1.fc20 will be reinstalled
--> Finished dependency resolution
Dependencies resolved.

================================================================================
 Package        Arch            Version                  Repository        Size
================================================================================
Reinstalling:
 yumex          noarch          3.0.14-1.fc20            updates          431 k

Transaction Summary
================================================================================

Total download size: 431 k
Is this ok [y/N]: y
Downloading Packages:
yumex-3.0.14-1.fc20.noarch.rpm                  136 kB/s | 431 kB     00:03    
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Reinstalling: yumex-3.0.14-1.fc20.noarch                                  1/2 
  Verifying   : yumex-3.0.14-1.fc20.noarch                                  1/2 
  Verifying   : yumex-3.0.14-1.fc20.noarch                                  2/2 
Complete!
[parag@f20 ~]$ sudo dnf reinstall iok
Resolving dependencies
--> Starting dependency resolution
---> Package iok.x86_64 2.1.3-4.fc20 will be reinstalled
--> Finished dependency resolution
Dependencies resolved.

================================================================================
 Package       Arch             Version                  Repository        Size
================================================================================
Reinstalling:
 iok           x86_64           2.1.3-4.fc20             fedora           114 k

Transaction Summary
================================================================================

Total download size: 114 k
Is this ok [y/N]: y
Downloading Packages:
iok-2.1.3-4.fc20.x86_64.rpm                     307 kB/s | 114 kB     00:00    
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Reinstalling: iok-2.1.3-4.fc20.x86_64                                     1/2 
error: iok-2.1.3-4.fc20.x86_64: erase failed
  Verifying   : iok-2.1.3-4.fc20.x86_64                                     1/2 
  Verifying   : iok-2.1.3-4.fc20.x86_64                                     2/2 
Complete!
[parag@f20 ~]$ 


I am not sure why iok package failed to erase here?

Comment 2 Panu Matilainen 2014-03-04 07:39:41 UTC
The erase failure is because of the way dnf tries to do reinstall, which is not supported by rpm:

            elif tsi.op_type == REINSTALL:
                ts.addErase(tsi.erased.idx)
                hdr = tsi.installed.header
                ts.addInstall(hdr, tsi, 'i')
                self.logger.debug("populate_rpm_ts: reinstall: %s" %
                                  tsi.erased)

dnf adds an erasure element, which would technically be the right way to perform a reinstall, but the installing with rpm.RPMPROB_FILTER_REPLACEPKG causes the header scheduled for removal to move, so its erasure fails. And without rpm.RPMPROB_FILTER_REPLACEPKG its not possible to do the install at all.

What's needed is a proper reinstall method in rpm (see bug 966715), until then dnf should just drop the addErase() part which is not going to work.

Comment 3 Panu Matilainen 2014-03-04 12:16:40 UTC
Created attachment 870380 [details]
/tmp/dnf-reinstall-0.patch

Proof-of-concept patch to use rpm's reinstall method.

Note that this will NOT work with existing rpm releases, addReinstall() only exists in rpm git master at the moment. So you'd need to check for the existence of that method in rpm.ts (but the wrapper might get in the way), and fall back to what yum does if its not there (ie just add the install element, no erase element, and enable at least rpm.RPMPROB_FILTER_REPLACEPKG)

The problem filter handling in dnf is ... problematic, there should never be any problem filters enabled by default, but that's another story, another related bug as well...

Comment 4 Adam Williamson 2014-03-07 22:36:39 UTC
I tried a 'dnf reinstall gjs gjs-debuginfo' this morning, and got "Nothing to do." 'yum reinstall gjs gjs-debuginfo' did the expected (reinstalled it).

Comment 5 Ivana Varekova 2014-06-26 09:44:09 UTC
*** Bug 1092830 has been marked as a duplicate of this bug. ***

Comment 6 Ales Kozumplik 2014-06-26 10:47:51 UTC
Radek, I'm reassigning this to Ivana who already has some knowledge about the problem.

Panu, is that correct that that addReinstall() won't be available in F20? In that case, Ivana, please fix this in the way it works in F20 Yum so we don't have a breakage like this.

Comment 7 Panu Matilainen 2014-06-26 10:55:22 UTC
I've no plans wrt backporting addReinstall() and everything it needs to rpm 4.11.x - it might happen or then (more likely) not. So for all currently released rpm versions, you need a different fix.

Comment 8 Honza Silhan 2014-08-28 13:10:41 UTC
Fixed in the upstream with Panu's help (thanks). Upstream DNF is dependent on rpm >= 4.12.0

Comment 9 Fedora Update System 2014-09-04 15:49:29 UTC
dnf-0.6.1-1.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/dnf-0.6.1-1.fc21

Comment 10 Fedora Update System 2014-09-06 00:59:59 UTC
Package dnf-0.6.1-1.fc21:
* should fix your issue,
* was pushed to the Fedora 21 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing dnf-0.6.1-1.fc21'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-10199/dnf-0.6.1-1.fc21
then log in and leave karma (feedback).

Comment 11 Fedora Update System 2014-09-23 04:40:13 UTC
dnf-0.6.1-1.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, 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.