Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-37552

"dnf remove --duplicates" reports an error if no packages are duplicated

    • dnf-4.20.0-1.el10
    • None
    • Impediment
    • Low
    • sst_cs_software_management
    • ssg_core_services
    • 16
    • 20
    • 3
    • QE nak, Dev ack
    • True
    • Hide

      QE nak, Dev ack

      Show
      QE nak, Dev ack
    • No
    • None
    • Hide

      AC: If no duplicate or old installonly packages are found, the commands `remove --duplicates` and `remove --oldinstallonly`, respectively, should exit with a return value of 0. It has removed all duplicate or old installonly packages it has discovered, in this case, zero. Also, the output should not be written to stderr, because it's not an error that there are no duplicates or old installonly packages.

      Test: to be written according to AC.

      Show
      AC: If no duplicate or old installonly packages are found, the commands `remove --duplicates` and `remove --oldinstallonly`, respectively, should exit with a return value of 0. It has removed all duplicate or old installonly packages it has discovered, in this case, zero. Also, the output should not be written to stderr, because it's not an error that there are no duplicates or old installonly packages. Test: to be written according to AC.
    • Pass
    • Automated
    • Bug Fix
    • Hide
      When no duplicates are present on the system and user calls "dnf remove --duplicates", dnf exited with non-zero exit code and wrote "No duplicated packages found for removal." on the stderr. With the fix, dnf exits with 0 and doesn't write anything on the stderr. The same issue with "dnf remove --oldinstallonly" when no older install-only packages are installed was fixed.
      Show
      When no duplicates are present on the system and user calls "dnf remove --duplicates", dnf exited with non-zero exit code and wrote "No duplicated packages found for removal." on the stderr. With the fix, dnf exits with 0 and doesn't write anything on the stderr. The same issue with "dnf remove --oldinstallonly" when no older install-only packages are installed was fixed.
    • Proposed
    • None

      Description of problem:
      yum remove --duplicates and dnf remove --duplicates both return stderr when no duplicates are found. Since this is the expected replacement for yum-complete-transactions, the command is introducing an error where none should be present.

      Version-Release number of selected component (if applicable):
      4.7.0
      Installed: dnf-0:4.7.0-16.el8_8.noarch at Tue Aug 29 17:51:15 2023
      Built : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla> at Wed Mar 8 10:33:55 2023

      Installed: rpm-0:4.14.3-26.el8.x86_64 at Tue Aug 29 17:50:53 2023
      Built : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla> at Mon Dec 19 17:08:54 2022
      4.7.0
      Installed: dnf-0:4.7.0-16.el8_8.noarch at Tue Aug 29 17:51:15 2023
      Built : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla> at Wed Mar 8 10:33:55 2023

      Installed: rpm-0:4.14.3-26.el8.x86_64 at Tue Aug 29 17:50:53 2023
      Built : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla> at Mon Dec 19 17:08:54 2022

      How reproducible:
      Consistently reproducible.

      Steps to Reproduce:
      1. dnf remove --duplicates 1>stdout.txt 2>stderr.txt
      2. OR
      3. yum remove --duplicates 1>stdout.txt 2>stderr.txt

      Actual results:
      cat stdout.txt
      Updating Subscription Management repositories.
      el8 84 kB/s | 1.5 kB 00:00
      biw-8-server-rpms 83 kB/s | 1.5 kB 00:00
      Red Hat CodeReady Linux Builder for RHEL 8 x86_ 137 kB/s | 4.5 kB 00:00
      oracle-instanclient21-for-rhel8-x86_64 77 kB/s | 1.3 kB 00:00
      Red Hat Enterprise Linux 8 for x86_64 - AppStre 136 kB/s | 4.5 kB 00:00
      SALT-PROJECT-3005-8-x86_64 90 kB/s | 1.5 kB 00:00
      EPEL-8-x86_64 137 kB/s | 2.3 kB 00:00
      Red Hat Enterprise Linux 8 for x86_64 - BaseOS 114 kB/s | 4.1 kB 00:00

      cat stderr.txt
      Error: No duplicated packages found for removal.

      Expected results:
      If no duplicate packages are found, the command should exit with a return value of 0. It has removed all duplicate packages it has discovered, in this case, zero.

      Additional info:

              rhn-support-ppisar Petr Pisar
              jira-bugzilla-migration RH Bugzilla Integration
              packaging-team-maint packaging-team-maint
              Jan Blazek Jan Blazek
              Mariya Pershina Mariya Pershina
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: