Uploaded image for project: 'RHEL Conversions'
  1. RHEL Conversions
  2. RHELC-1675

Return code 1 not handled when checking for duplicate packages on RHEL9 like systems

XMLWordPrintable

    • 1
    • Testable

      When the package-cleanup --dupes command fails on RHEL 9 like systems, the actual error message is displayed as if the duplicate packages were discovered.

      [2024-08-02T13:12:39+0000] TASK - [Prepare: Check if there are any duplicate installed packages on the system] 
      [2024-08-02T13:12:39+0000] DEBUG - Calling command '/usr/bin/package-cleanup --dupes --quiet'
      ERROR - (ERROR) DUPLICATE_PACKAGES::DUPLICATE_PACKAGES_FOUND - Duplicate packages found on the system
       Description: The system contains one or more packages with multiple versions.
       Diagnosis: The following packages have multiple versions: Unable to detect release version (use '--releasever' to specify release version), Error: Failed to download metadata for repo 'rhel-9-for-x86_64-appstream-rpms': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried.
       Remediations: This error can be resolved by removing duplicate versions of the listed packages. The command 'package-cleanup' can be used to automatically remove duplicate packages on the system.
      

      The issue lies here , where we do not include system major version 9.
      Tested with a patch of if system_info.version.major in (8, 9) and ret_code == 1: or if system_info.version.major >= 8 and ret_code == 1: and works fine.

      NOTE: If deemed sufficient, the fix can be a part of https://github.com/oamg/convert2rhel/pull/946

              prwatson@redhat.com Preston Watson
              ddiblik@redhat.com Daniel Diblik
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: