Bug 1284981 - RFE: implement `restore` dnf plugin to remove duplicated packages on the system
RFE: implement `restore` dnf plugin to remove duplicated packages on the system
Product: Fedora
Classification: Fedora
Component: dnf-plugins-extras (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: rpm-software-management
Fedora Extras Quality Assurance
: FutureFeature, Triaged
: 1277697 1291432 1366122 (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2015-11-24 10:30 EST by cornel panceac
Modified: 2016-11-25 07:20 EST (History)
13 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-11-25 07:20:18 EST
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 cornel panceac 2015-11-24 10:30:40 EST
Description of problem:
During the gold age of 'yum', 'yum reinstall <packagename>' would reinstall the package and cleanup the existing duplicate (for example left by a broken transaction.)
'dnf' is unable to do it and there seems to be no other way to do it.

For example:

'yum-deprecated check' says:
zlib-1.2.8-9.fc23.i686 is a duplicate with zlib-1.2.8-7.fc22.i686

then we try to fix this manually:

# dnf reinstall zlib
Last metadata expiration check performed 1:27:28 ago on Tue Nov 24 15:46:41 2015.
Dependencies resolved.
 Package                  Arch                  Version                          Repository                Size
 zlib                     i686                  1.2.8-9.fc23                     fedora                    98 k
     replacing  zlib.i686 1.2.8-7.fc22
 minizip                  i686                  1.2.8-7.fc22                     @System                   54 k

Transaction Summary
Remove  1 Package

Total size: 98 k
Is this ok [y/N]: y
Downloading Packages:
[SKIPPED] zlib-1.2.8-9.fc23.i686.rpm: Already downloaded                                                       
Running transaction check
Transaction check succeeded.
Running transaction test
The downloaded packages were saved in cache till the next successful transaction.
You can remove cached packages by executing 'dnf clean packages'.
Error: Transaction check error:
  file /usr/lib/libz.so.1.2.8 from install of zlib-1.2.8-9.fc23.i686 conflicts with file from package zlib-1.2.8-7.fc22.i686

Error Summary
<actually, no error summary can be seen here>

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

How reproducible:

Steps to Reproduce:
1.for any package that has a duplicate, try to reinstall it in order to remove the duplicate

Actual results:
package is not reinstalled, duplicate is not removed

Expected results:
package is reinstalled, duplicate is removed

Additional info:
Of course, ideally we should have a way to do this automatically for ALL duplicated packages.
Comment 1 cornel panceac 2015-11-24 10:34:53 EST
By the way, it would be nice if this is the default behaviour of upgrade, also.
Comment 2 Honza Silhan 2015-12-14 08:45:20 EST
reinstall works as expected. The problems of previous transactions should be fixed by plugin or manually. DNF cannot know what is expected operation from user's POV.
Comment 3 cornel panceac 2015-12-15 00:46:46 EST
Not sure 'restore' is the right word. I'd rather call it 'cleanup_duplicates'. On the other hand, dnf-plugins-extras is not yet available, right?
Comment 4 Honza Silhan 2015-12-23 09:58:44 EST
*** Bug 1291432 has been marked as a duplicate of this bug. ***
Comment 5 Honza Silhan 2015-12-23 10:06:14 EST
'cleanup_duplicates' sounds good. It will be a separate subpackage in dnf-plugins-extras (this already exists).
Comment 6 Fedora Admin XMLRPC Client 2016-07-21 08:41:05 EDT
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 7 Honza Silhan 2016-08-15 07:39:58 EDT
*** Bug 1366492 has been marked as a duplicate of this bug. ***
Comment 8 Honza Silhan 2016-08-15 07:45:01 EDT
*** Bug 1366122 has been marked as a duplicate of this bug. ***
Comment 9 Igor Gnatenko 2016-08-22 07:11:48 EDT
*** Bug 1277697 has been marked as a duplicate of this bug. ***
Comment 10 Fedora End Of Life 2016-11-24 08:41:52 EST
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 11 Florian Weimer 2016-11-24 08:42:47 EST
(In reply to Honza Silhan from comment #5)
> 'cleanup_duplicates' sounds good. It will be a separate subpackage in
> dnf-plugins-extras (this already exists).

Is this a good idea?  When I need this functionality, I'm usually not able to install additional packages.
Comment 12 Michael Mráka 2016-11-25 07:20:18 EST
To list duplicated packages use

dnf repoquery --duplicated

To remove them

dnf remove --duplicates


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