AIX Open Source

AIX Open Source

Share your experiences and connect with fellow developers to discover how to build and manage open source software for the AIX operating system

 View Only
  • 1.  DNF breaks yumdb (and maybe rest of yum-utils?)

    Posted Tue January 18, 2022 09:36 PM

    After upgrading to DNF, yumdb throws below error:

    # yumdb unset from_repo
    Traceback (most recent call last):
      File "/usr/sbin/yumdb", line 7, in <module>
        import yum
    ImportError: No module named yum
    


    We can see that yumdb is a python2 script:

    # which yumdb
    /usr/sbin/yumdb
    # ls -l /usr/sbin/yumdb
    lrwxrwxrwx    1 root     system           29 Jan  7 15:24 /usr/sbin/yumdb -> ../../opt/freeware/sbin/yumdb
    
    
    # head /opt/freeware/sbin/yumdb
    #!/opt/freeware/bin/python2 -tt
    
    import sys
    import optparse
    import fnmatch
    
    import yum
    import shlex
    
    parser = None


    On a yum system, I can see a python2.7 yum module

    MULTIBOS> find ./opt/ -name "yum*"
    	...
    ./opt/freeware/lib/python2.7/site-packages/yum


    vs. a system running dnf:

    # find /opt/freeware/lib* -name "yum*"
    /opt/freeware/lib/python2.7/site-packages/yum_metadata_parser-1.1.4-py2.7.egg-info
    /opt/freeware/lib/python2.7/site-packages/yumutils
    /opt/freeware/lib/python3.7/site-packages/dnf/yum


    It looks like the required python2 yum module is packaged with yum:

    MULTIBOS> rpm -qf /opt/freeware/lib/python2.7/site-packages/yum
    yum-3.4.3-7.noarch


    So what to do? 
    I'm pretty sure yum-utils.rpm need to have a dependency of yum.rpm, and thus will be removed with YUM during a migration to DNF.
    (Since the github project is marked deprecated).
    https://github.com/rpm-software-management/yum-utils
    https://github.com/rpm-software-management/yum-utils/blob/master/README

    It seems there is no direct yum-utils / yumdb replacement in DNF.
    https://bugzilla.redhat.com/show_bug.cgi?id=1227949
    https://bugzilla.redhat.com/show_bug.cgi?id=1682969






    ------------------------------
    Cory
    ------------------------------


  • 2.  RE: DNF breaks yumdb (and maybe rest of yum-utils?)

    Posted Tue January 18, 2022 09:38 PM
    Hi Cory

    Have you gone through the following steps yet?

    --> AIX migration with DNF
    https://community.ibm.com/community/user/power/blogs/sangamesh-mallayya1/2022/01/10/aix-migration-with-dnf

    ------------------------------
    Jan Harris
    ------------------------------



  • 3.  RE: DNF breaks yumdb (and maybe rest of yum-utils?)

    Posted Fri January 21, 2022 05:46 PM
    Hi Jan

    I have not, as the server is still AIX 7.1
    # oslevel -s
    7100-05-08-2114
    ​


    But even following some of the steps to see if any apply, I don't see any errors.

    # /usr/sbin/updtvpkg
    Please wait...
    # dnf check
    # 


    But going further down the "yum-utils dependency" trail, we see that yum-utils has a dependency on yum version 3.2.29+, but the installed yum is just a symlink.

    # rpm -qR yum-utils
    yum >= 3.2.29
    /opt/freeware/bin/python2
    
    # which yum
    /opt/freeware/bin/yum
    
    # yum --version
    4.2.17
      Installed: dnf-0:4.2.17-32_1.noarch at Thu Oct 14 12:32:39 2021
      Built    : IBM AIX Toolbox  <https://ibm.biz/AIXToolbox> at Wed Jul 21 08:42:32 2021
    
    # rpm -q yum
    yum-4.2.17-32_1.noarch
    
    # ls -l /opt/freeware/bin/yum
    lrwxrwxrwx    1 root     system            5 Oct 14 08:32 /opt/freeware/bin/yum -> dnf-3
    


    I just feel like there is a missing "yum < 4" dependency for the yum-utils package.

    We can see yum-4.2.17-32_1.aix7.1.noarch.rpm is coming from the dnf_bundle, only providing the yum -> dnf-3 symlink, and not advertised in the rpm repo.

    # tar -tvf dnf_bundle_aix_71_72.tar |grep yum
    -rw------- 0   0     9188 Jul 21 07:10:25 2021 yum-4.2.17-32_1.aix7.1.noarch.rpm
    
    # rpm -qlp yum-4.2.17-32_1.aix7.1.noarch.rpm
    /opt/freeware/bin/yum
    
    # dnf --showduplicates list yum
    Last metadata expiration check: 4:27:50 ago on Fri Jan 21 12:13:47 2022.
    Available Packages
    yum.noarch                    3.4.3-1                    AIX_Toolbox       
    yum.noarch                    3.4.3-1                    AIX_Toolbox_noarch
    yum.noarch                    3.4.3-1                    AIX_Toolbox_ppc   
    yum.noarch                    3.4.3-2                    AIX_Toolbox_noarch
    yum.noarch                    3.4.3-3                    AIX_Toolbox_noarch
    yum.noarch                    3.4.3-4                    AIX_Toolbox_noarch
    yum.noarch                    3.4.3-5                    AIX_Toolbox_noarch
    yum.noarch                    3.4.3-6                    AIX_Toolbox_noarch
    yum.noarch                    3.4.3-7                    AIX_Toolbox_noarch
    yum.noarch                    3.4.3-8                    AIX_Toolbox_noarch



    Or maybe some other option?  I'm just not sure, as the best solution requires a better understanding of other activities happening during the YUM to DNF migration.

    NOTE: But even with uninstalling the yum-4 rpm, I worry about accidentally installing yum-3 via a dependency.  I wonder if all rpm's in the repo should be checked for yum dependency and updated to require <4 or if there maybe should be a separate repo for YUM and its dependent rpm's vs. DNF.

    # dnf remove yum
       (output omitted)
    
    # dnf install yum-utils
    Last metadata expiration check: 4:43:48 ago on Fri Jan 21 12:13:47 2022.
    Dependencies resolved.
    ==============================================================================================
     Package             Architecture     Version               Repository                    Size
    ==============================================================================================
    Installing:
     yum-utils           noarch           1.1.31-2              AIX_Toolbox_noarch            88 k
    Installing dependencies:
     yum                 noarch           3.4.3-8               AIX_Toolbox_noarch           1.3 M
    
    Transaction Summary
    ==============================================================================================
    Install  2 Packages
    
    Total size: 1.4 M
    


    In the meantime, I've uninstalled yum-4 and excluded yum at the end of the [main] section in dnf.conf:
    # grep -p exclude /opt/freeware/etc/dnf/dnf.conf
    [main]
    cachedir=/var/cache/dnf
    keepcache=1
    debuglevel=2
    logfile=/var/log/dnf.log
    exactarch=1
    gpgcheck=1
    installonly_limit=3
    clean_requirements_on_remove=True
    best=True
    exclude=yum



    This at least generates an error when trying to install a yum dependent rpm:
    # dnf install yum-utils                         
    Last metadata expiration check: 0:02:03 ago on Fri Jan 21 17:39:33 2022.
    Error: 
     Problem: package yum-utils-1.1.31-2.noarch requires yum >= 3.2.29, but none of the providers can be installed
      - cannot install the best candidate for the job
      - package yum-3.4.3-1.noarch is filtered out by exclude filtering
      - package yum-3.4.3-2.noarch is filtered out by exclude filtering
      - package yum-3.4.3-3.noarch is filtered out by exclude filtering
      - package yum-3.4.3-4.noarch is filtered out by exclude filtering
      - package yum-3.4.3-5.noarch is filtered out by exclude filtering
      - package yum-3.4.3-6.noarch is filtered out by exclude filtering
      - package yum-3.4.3-7.noarch is filtered out by exclude filtering
      - package yum-3.4.3-8.noarch is filtered out by exclude filtering
    (try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)​


    ------------------------------
    Cory
    ------------------------------



  • 4.  RE: DNF breaks yumdb (and maybe rest of yum-utils?)

    Posted Mon January 24, 2022 04:39 AM
    yum-utils is a package for yum-3 once you migrate to dnf it is recommended that you use dnf.
    There is yum wrapper provided for dnf called yum-4 but yum-utils does not work with that.

    ------------------------------
    SANKET RATHI
    ------------------------------



  • 5.  RE: DNF breaks yumdb (and maybe rest of yum-utils?)

    Posted Mon January 24, 2022 09:15 AM
    Edited by Cory Beverlin Mon January 24, 2022 09:16 AM
    I understand yum-utils is to work with yum-3.

    What I'm trying to say is that I think the yum-utils should have a dependency to also exclude the yum-4 "wrapper" (just looks like a symlink to me).  Technically, the way IBM has packaged yum-4, the symlink to dnf meets the requirement, although it should not.
    # rpm -qR yum-utils
    yum >= 3.2.29
    /opt/freeware/bin/python2​


    What is the strategy to handle these packages that depend on yum or dnf, but are incompatible with the other? 
    Having them co-mingled in the same repo is very confusing.  Not having proper dependencies will lead to errors.



    ------------------------------
    Cory
    ------------------------------



  • 6.  RE: DNF breaks yumdb (and maybe rest of yum-utils?)

    Posted Tue January 25, 2022 12:27 AM
    Thanks Cory. Now I got your point. 
    We will look into these issues and fix them.
    Once yum3 is removed and yum4 is installed yum-utils should not been there.
    And also it should not get installed if yum-3 is not there as it is not suppose to work with yum4.
    We will discuss internally and see what is the best way to fix them.

    ------------------------------
    SANKET RATHI
    ------------------------------



  • 7.  RE: DNF breaks yumdb (and maybe rest of yum-utils?)

    Posted Tue January 25, 2022 02:53 PM
    Edited by Cory Beverlin Tue January 25, 2022 04:22 PM
    Sanket,

    Once yum3 is removed and yum4 is installed yum-utils should not been there.
      - Agreed.  But, I have not encountered or tested this scenario yet.  From the looks of the install_dnf.sh script and the output, yum is "upgraded" to version 4, but this doesn't look like it will trigger an uninstall of yum/yum-3 dependent RPM's.  Perhaps an explicit uninstall of yum followed by the install of yum-4?  But it would be nice to output the "incompatible" packages that are going to be removed and not compatible with yum-4/dnf.

    And also it should not get installed if yum-3 is not there as it is not suppose to work with yum4.
      - Based on your response and my observations, that is what I understand as well.  I did find a bug indicating this "yum >=3 with yum < 4"  may now be possible with the "with" rich requirement.  Perhaps something to look at.
    https://bugzilla.redhat.com/show_bug.cgi?id=1389871

    This has been implemented in rpm as of >= 4.13.90 which is in rawhide/f27 now, using the new "with" rich dependency syntax:
    
    Requires: (foo >= 1.0 with foo < 2.0)
    
    https://github.com/rpm-software-management/rpm/issues/159



    It looks like the rpm version should support it.
    # lslpp -l rpm.rte
      Fileset                      Level  State      Description         
      ----------------------------------------------------------------------------
    Path: /usr/lib/objrepos
      rpm.rte                   4.15.1.3  COMMITTED  RPM Package Manager
    
    Path: /etc/objrepos
      rpm.rte                   4.15.1.3  COMMITTED  RPM Package Manager
    # rpm --version                                  
    RPM version 4.15.1
    ​


    But I'm not sure about dnf based on the last line of the dnf requirements...
    # rpm -qR dnf
    /bin/sh
    /bin/sh
    /bin/sh
    /bin/sh
    /opt/freeware/bin/python3_32
    python3-dnf = 4.2.17-32_1
    rpmlib(CompressedFileNames) <= 3.0.4-1
    rpmlib(FileDigests) <= 4.6.0-1
    rpmlib(PayloadFilesHavePrefix) <= 4.0-1
    rpmlib(RichDependencies) <= 4.12.0-1​



    I also tried to determine a list of rpm's that may need to have their yum-3 dependency updated.  We can see yum-utils is at the bottom of the list, so at least that's some validation.
    NOTE: I had to comment out the "exclude=yum" from my dnf.conf configuration, otherwise the output was nothing.
    UPDATE: The config file does not need modified if we reset the exclusions in the command.
      dnf repoquery --exclude= --whatrequires yum
    # dnf repoquery --requires yum-utils
    Last metadata expiration check: 0:10:17 ago on Tue Jan 25 14:34:45 2022.
    /opt/freeware/bin/python2
    /usr/bin/python
    yum >= 3.2.29
    
    
    # dnf repoquery --whatrequires yum  
    Last metadata expiration check: 0:10:28 ago on Tue Jan 25 14:34:45 2022.
    createrepo-0:0.10.3-2.noarch
    createrepo-0:0.10.3-3.noarch
    yum-plugin-aliases-0:1.1.31-1.noarch
    yum-plugin-aliases-0:1.1.31-2.noarch
    yum-plugin-allowdowngrade-0:1.1.31-1.noarch
    yum-plugin-allowdowngrade-0:1.1.31-2.noarch
    yum-plugin-basearchonly-0:1.1.31-1.noarch
    yum-plugin-basearchonly-0:1.1.31-2.noarch
    yum-plugin-changelog-0:1.1.31-1.noarch
    yum-plugin-changelog-0:1.1.31-2.noarch
    yum-plugin-downloadonly-0:1.1.31-1.noarch
    yum-plugin-downloadonly-0:1.1.31-2.noarch
    yum-plugin-fastestmirror-0:1.1.31-1.noarch
    yum-plugin-fastestmirror-0:1.1.31-2.noarch
    yum-plugin-filter-data-0:1.1.31-1.noarch
    yum-plugin-filter-data-0:1.1.31-2.noarch
    yum-plugin-keys-0:1.1.31-1.noarch
    yum-plugin-keys-0:1.1.31-2.noarch
    yum-plugin-list-data-0:1.1.31-1.noarch
    yum-plugin-list-data-0:1.1.31-2.noarch
    yum-plugin-local-0:1.1.31-1.noarch
    yum-plugin-local-0:1.1.31-2.noarch
    yum-plugin-merge-conf-0:1.1.31-1.noarch
    yum-plugin-merge-conf-0:1.1.31-2.noarch
    yum-plugin-post-transaction-actions-0:1.1.31-1.noarch
    yum-plugin-post-transaction-actions-0:1.1.31-2.noarch
    yum-plugin-priorities-0:1.1.31-1.noarch
    yum-plugin-priorities-0:1.1.31-2.noarch
    yum-plugin-protectbase-0:1.1.31-1.noarch
    yum-plugin-protectbase-0:1.1.31-2.noarch
    yum-plugin-ps-0:1.1.31-1.noarch
    yum-plugin-ps-0:1.1.31-2.noarch
    yum-plugin-remove-with-leaves-0:1.1.31-1.noarch
    yum-plugin-remove-with-leaves-0:1.1.31-2.noarch
    yum-plugin-rpm-warm-cache-0:1.1.31-1.noarch
    yum-plugin-rpm-warm-cache-0:1.1.31-2.noarch
    yum-plugin-show-leaves-0:1.1.31-1.noarch
    yum-plugin-show-leaves-0:1.1.31-2.noarch
    yum-plugin-tmprepo-0:1.1.31-1.noarch
    yum-plugin-tmprepo-0:1.1.31-2.noarch
    yum-plugin-tsflags-0:1.1.31-1.noarch
    yum-plugin-tsflags-0:1.1.31-2.noarch
    yum-plugin-verify-0:1.1.31-1.noarch
    yum-plugin-verify-0:1.1.31-2.noarch
    yum-plugin-versionlock-0:1.1.31-1.noarch
    yum-plugin-versionlock-0:1.1.31-2.noarch
    yum-utils-0:1.1.31-1.noarch
    yum-utils-0:1.1.31-2.noarch​


    I hope you find the above helpful and I look forward to IBM's resolution.

    Thanks!


    ------------------------------
    Cory Beverlin
    ------------------------------