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

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

    • dnf-4.14.0-12.el9
    • None
    • Impediment
    • Low
    • rhel-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
    • Yes
    • 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
    • None
    • Bug Fix
    • Hide
      .`dnf remove --duplicates` no longer exits with non-zero exit code and error message

      Previously, if you ran the `dnf remove --duplicates` command when no duplicate packages were present on the system, `dnf` exited with non-zero exit code and the `No duplicated packages found for removal.` error on standard error output (`stderr`). With this update, `dnf` now exits with `0` and does not write anything on `stderr`. Note that the same issue was also fixed for the `dnf remove --oldinstallonly` command when no older versions of `installonly` packages are installed.
      Show
      .`dnf remove --duplicates` no longer exits with non-zero exit code and error message Previously, if you ran the `dnf remove --duplicates` command when no duplicate packages were present on the system, `dnf` exited with non-zero exit code and the `No duplicated packages found for removal.` error on standard error output (`stderr`). With this update, `dnf` now exits with `0` and does not write anything on `stderr`. Note that the same issue was also fixed for the `dnf remove --oldinstallonly` command when no older versions of `installonly` packages are installed.
    • Done
    • 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
              Eva Mrakova Eva Mrakova
              Mariya Pershina Mariya Pershina
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

                Created:
                Updated:
                Resolved: