AIX Open Source

 View Only
  • 1.  dnf error while executing postinstall script

    Posted 24 days ago

    Hello team,

    I have come across a strange behavior in dnf. When I try to install a self-built RPM package via dnf, I get the following error message:

    Could not load program gawk_64:
    Symbol resolution failed for gawk_64 because:
            Symbol _GLOBAL__AIXI_libintl_so (number 176) is not exported from dependent
              module /usr/opt/rpm/lib/libintl.a[libintl.so.8].
            Symbol _GLOBAL__AIXD_libintl_so (number 177) is not exported from dependent
              module /usr/opt/rpm/lib/libintl.a[libintl.so.8].
    Examine .loader section symbols with the 'dump -Tv' command.

    The error occurs postinstall scriptlet of the RPM package when this is executed:

    HOSTNAME=$(hostname)
    FQDN=$(host ${HOSTNAME} | head -n 1 | awk -F' ' '{ print $1}')

    The problem only occurs when the installation is done with dnf and gawk is installed on the system. Then there is a /opt/freeware/bin/awk, which is probably causing the error.

    The error does not occur if I install the package directly with rpm. The error also does not occur if gawk is not installed.

    It seems that an incorrect path may have been set here within the dnf environment, so that executables are first searched for in /opt/freeware/bin and not in /usr/bin. I didn't have this problem with older dnf versions.

    # dnf list installed gawk dnf
    Installed Packages
    dnf.ppc                                                 4.2.17-32_51                                                 @AIX_Toolbox_72
    gawk.ppc                                                5.2.2-1                                                      @AIX_Toolbox

    # oslevel -s
    7200-05-08-2420

    Am I seeing this wrong or is this a problem with dnf?

    Thank you in advance

    Ralph



    ------------------------------
    Ralph Baumann
    ------------------------------


  • 2.  RE: dnf error while executing postinstall script

    Posted 24 days ago

    Since you mentioned self built RPM, I am assuming you have compiled gawk and built successfully. 

    So when you tried building Gawk, which library did you try linking to? Even if you have correctly linked to /opt/freeware/lib/libintl which has those two symbols, when you tried to install the RPM since it found libintl in your /usr/opt/rpm/lib/libintl.a and then got surprised as to why those two symbols are not there. 

    Can you try in your LDFLAGS while building to give the full path, i.e /opt/freeware/lib/libintl.a instead of plain -lintl and then rebuild to create RPM and install RPM. 

    What this will do is force your gawk to link to  /opt/freeware/lib/libintl.a instead of searching in all possible directories and then finding it in /usr/opt/rpm/lib/.

    It should work then.



    ------------------------------
    Aditya Kamath
    ------------------------------



  • 3.  RE: dnf error while executing postinstall script

    Posted 23 days ago

    Hi Ralph

    This is because of the implicit LIBPATH set in the /opt/freeware/lib/python3.9/site-packages/dnf/__init__.py due to historical reason.

    I think this file can have change as below so someone can set their own LIBPATH as /opt/freeware/lib:/usr/opt/rpm/lib:/usr/lib:/lib which can avoid these errors.

    --- /opt/freeware/lib/python3.9/site-packages/dnf/__init__.py.bak       2024-08-15 11:09:39.293269104 -0500
    +++ /opt/freeware/lib/python3.9/site-packages/dnf/__init__.py   2024-08-15 11:20:21.365192085 -0500
    @@ -20,7 +20,8 @@

     from __future__ import unicode_literals
     import os
    -os.environ['LIBPATH'] = '/usr/opt/rpm/lib:/opt/freeware/lib:/usr/lib:/lib'
    +if not "LIBPATH" in os.environ:
    +    os.environ['LIBPATH'] = '/usr/opt/rpm/lib:/opt/freeware/lib:/usr/lib:/lib'
     import warnings
     import dnf.pycomp

    And the command can be run as.

    LIBPATH=/opt/freeware/lib::/usr/opt/rpm/lib:/usr/lib:/lib dnf install -y <pkgname>



    ------------------------------
    SANGAMESH
    ------------------------------