Bug 1284981

Summary: RFE: implement `restore` dnf plugin to remove duplicated packages on the system
Product: [Fedora] Fedora Reporter: cornel panceac <cpanceac>
Component: dnf-plugins-extrasAssignee: rpm-software-management
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 23CC: fweimer, green, jkadlcik, jmracek, jsilhan, lnie, mluscon, mmraka, nmreis, omerusta, packaging-team-maint, pnemade, vmukhame
Target Milestone: ---Keywords: FutureFeature, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-25 12:20:18 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 cornel panceac 2015-11-24 15:30:40 UTC
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
================================================================================================================
Reinstalling:
 zlib                     i686                  1.2.8-9.fc23                     fedora                    98 k
     replacing  zlib.i686 1.2.8-7.fc22
Removing:
 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:
always


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

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 15:34:53 UTC
By the way, it would be nice if this is the default behaviour of upgrade, also.

Comment 2 Honza Silhan 2015-12-14 13:45:20 UTC
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 05:46:46 UTC
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 14:58:44 UTC
*** Bug 1291432 has been marked as a duplicate of this bug. ***

Comment 5 Honza Silhan 2015-12-23 15:06:14 UTC
'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 12:41:05 UTC
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 11:39:58 UTC
*** Bug 1366492 has been marked as a duplicate of this bug. ***

Comment 8 Honza Silhan 2016-08-15 11:45:01 UTC
*** Bug 1366122 has been marked as a duplicate of this bug. ***

Comment 9 Igor Gnatenko 2016-08-22 11:11:48 UTC
*** Bug 1277697 has been marked as a duplicate of this bug. ***

Comment 10 Fedora End Of Life 2016-11-24 13:41:52 UTC
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 13:42:47 UTC
(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 12:20:18 UTC
To list duplicated packages use

dnf repoquery --duplicated

To remove them

dnf remove --duplicates



dnf-2.0.0-0.rc1.1