Bug 1462374 - dnf remove --duplicates fails to remove duplicate package
dnf remove --duplicates fails to remove duplicate package
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: dnf (Show other bugs)
rawhide
x86_64 Linux
unspecified Severity high
: ---
: ---
Assigned To: rpm-software-management
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-06-16 18:37 EDT by George R. Goffe
Modified: 2017-06-21 23:25 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-06-21 07:33:15 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description George R. Goffe 2017-06-16 18:37:26 EDT
Description of problem:

octive.GeographicLib had a preun problem which may be the reason there are duplicate packages in this system now. package-cleanup --cleandupes threw a traceback (see below) but it suggested using dnf so I tried "dnf remove --duplicates" which also failed (see below)

Version-Release number of selected component (if applicable):
dnf-2.5.1-1.fc27.noarch

How reproducible:
always

Steps to Reproduce:
1.see below
2.
3.

Actual results:
see below

Expected results:
correct package removal

Additional info:


First failure (non dnf):


Yum-utils package has been deprecated, use dnf instead.
See 'man yum2dnf' for more information.


Loaded plugins: product-id
--> Running transaction check
---> Package octave-GeographicLib.noarch 0:1.48-1.fc27 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================================================================================
 Package                                 Arch                      Version                          Repository                    Size
=======================================================================================================================================
Removing:
 octave-GeographicLib                    noarch                    1.48-1.fc27                      installed                    182 k

Transaction Summary
=======================================================================================================================================
Remove  1 Package

Installed size: 182 k
Is this ok [y/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction (shutdown inhibited)
Traceback (most recent call last):
  File "/bin/package-cleanup", line 402, in <module>
    util = PackageCleanup()
  File "/bin/package-cleanup", line 61, in __init__
    self.main()
  File "/bin/package-cleanup", line 396, in main
    sys.exit(self.doUtilTransaction())
  File "/usr/share/yum-cli/utils.py", line 420, in doUtilTransaction
    return_code = self.doTransaction()
  File "/usr/share/yum-cli/cli.py", line 799, in doTransaction
    resultobject = self.runTransaction(cb=cb)
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 1747, in runTransaction
    if self.fssnap.available and ((self.conf.fssnap_automatic_pre or
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 1142, in <lambda>
    fssnap = property(fget=lambda self: self._getFSsnap(),
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 1078, in _getFSsnap
    devices=devices)
  File "/usr/lib/python2.7/site-packages/yum/fssnapshots.py", line 158, in __init__
    self._vgnames = _list_vg_names() if self.available else []
  File "/usr/lib/python2.7/site-packages/yum/fssnapshots.py", line 56, in _list_vg_names
    names = lvm.listVgNames()
lvm.LibLVMError: (0, '')


Second failure, dnf:


dnf remove --duplicates
Dependencies resolved.
=======================================================================================================================================
 Package                                 Arch                      Version                        Repository                      Size
=======================================================================================================================================
Removing:
 octave-GeographicLib                    noarch                    1.48-1.fc27                    @_dnf_local                    182 k

Transaction Summary
=======================================================================================================================================
Remove  1 Package

Freed space: 182 k
Is this ok [y/N]: y
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                               1/1 
  Running scriptlet: octave-GeographicLib-1.48-1.fc27.noarch                                                                       1/1 
/var/tmp/rpm-tmp.1EpBuP: line 7: /usr/share/octave/packages/%{octpkg}-1.48/packinfo/on_uninstall.m: No such file or directory
error: %preun(octave-GeographicLib-1.48-1.fc27.noarch) scriptlet failed, exit status 1
Error in PREUN scriptlet in rpm package octave-GeographicLib
Error in PREUN scriptlet in rpm package octave-GeographicLib
octave-GeographicLib-1.48-1.fc27.noarch was supposed to be removed but is not!
  Verifying        : octave-GeographicLib-1.48-1.fc27.noarch                                                                       1/1

Failed:
  octave-GeographicLib.noarch 1.48-1.fc27

Error: Transaction failed

rpm -qa | grep octave-geographiclib
octave-GeographicLib-1.48-1.fc27.noarch
octave-GeographicLib-1.48-1.fc27.noarch

rpm --nodeps --noscripts -e octave-GeographicLib also fails... complaining about duplicates. --justdb also fails with the same complaint.
Comment 1 Daniel Mach 2017-06-21 07:33:15 EDT
This is something that can't be fixed in DNF or RPM.
It's more a packaging problem - the scriptlet is failing.
You can probably remove it by hand by running rpm -e --noscripts <rpm>
Comment 2 George R. Goffe 2017-06-21 23:25:39 EDT
Daniel,

NONE of your suggested fixes have worked.

I have even tried rebuilding the rpmdb without success.

Something in "rpm land" is in error. I just don't know enough about rpm to figure out what that is. Maybe physically removing all "evidence" of this duplicate rpm and then rebuilding the rpm db?

Of course, the package was in error.

I bet that if I were a paying customer, you guys could find a fix for me.

If you want to close this bug you should change it to cantfix.

George...

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