AIX Open Source

 View Only
  • 1.  Both YUM and SUDO broke after yum install curl

    Posted Wed August 04, 2021 07:02 PM
    Edited by Dharma Sanassy Wed August 04, 2021 07:35 PM

    Need some assistance Please:

    I just installed YUM on my AIX server acting as an AIX repo client. All worked out until I thought I need to install curl again:
     I got the following errors:
    here was a problem importing one of the Python modules
    required to run yum. The error leading to this problem was:

    0509-022 Cannot load module /opt/freeware/lib/libcurl.a(libcurl.so.4).
    0509-150 Dependent module /usr/lib/libldap.a(libldap-2.4.so.2) could not be loaded.
    0509-153 File /usr/lib/libldap.a is not an archive or
    the file could not be read properly.
    0509-026 System error: Cannot run a file that does not have a valid format.
    0509-022 Cannot load module /opt/freeware/lib/python2.7/site-packages/pycurl.so.
    0509-150 Dependent module /opt/freeware/lib/libcurl.a(libcurl.so.4) could not be loaded.

    Please install a package which provides this module, or
    verify that the module is installed correctly.

    It's possible that the above module doesn't match the
    current version of Python, which is:
    2.7.10 (default, Jun 22 2016, 05:57:59) [C]

    If you cannot solve this problem yourself, please go to
    the yum faq at:
    http://yum.baseurl.org/wiki/Faq



    Going thru some blogs , as suggested by AIX Opensource team : I issued the following commands:
    root @res1: / $export LIBPATH=/opt/freeware/lib64:/opt/freeware/lib:/usr/lib
    root @res1: / $echo $LIBPATH
    /opt/freeware/lib64:/opt/freeware/lib:/usr/lib
    root @res1: / $yum repolist
    exec(): 0509-036 Cannot load program /opt/freeware/bin/python2 because of the following errors:
    0509-150 Dependent module /opt/freeware/lib64/libpython2.7.aroot @resig1: /opt/freeware/etc/yum $sudo -V
    exec(): 0509-036 Cannot load program sudo because of the following errors:
    0509-150 Dependent module /opt/freeware/lib64/libintl.a(libintl.so.8) could not be loaded.
    0509-103 The module has an invalid magic number.
    (libpython2.7.so) 

    It got rid some errors but I have new one ones as show above.

    Furthermore it broke my sudo installations:

    root @res1: /opt/freeware/etc/yum $sudo -V
    exec(): 0509-036 Cannot load program sudo because of the following errors:
    0509-150 Dependent module /opt/freeware/lib64/libintl.a(libintl.so.8) could not be loaded.
    0509-103 The module has an invalid magic number.


    Upon unsetting LIBPATH
    echo $LIBPATH
    /opt/freeware/lib64:/opt/freeware/lib:/usr/lib:
    root @res1: /opt/freeware/etc/yum $unset LIBPATH

    Got SUDO to work again:
    a674 @resig1: /home/guest $sudo su -
    Password:

    root @res1: / $sudo -V | grep -i version
    Sudo version 1.9.5p2

    Sudoers policy plugin version 1.9.5p2
    Sudoers file grammar version 48
    Sudoers I/O plugin version 1.9.5p2
    Sudoers audit plugin version 1.9.5p2

    0
    Back to Original Errors

    root @resi1: / $yum repolist
    There was a problem importing one of the Python modules
    required to run yum. The error leading to this problem was:
    0509-022 Cannot load module /opt/freeware/lib/libcurl.a(libcurl.so.4).
    0509-150 Dependent module /usr/lib/libldap.a(libldap-2.4.so.2) could not be loaded.
    0509-153 File /usr/lib/libldap.a is not an archive or
    the file could not be read properly.
    0509-026 System error: Cannot run a file that does not have a valid format.
    0509-022 Cannot load module /opt/freeware/lib/python2.7/site-packages/pycurl.so.
    0509-150 Dependent module /opt/freeware/lib/libcurl.a(libcurl.so.4) could not be loaded.
    Please install a package which provides this module, or
    verify that the module is installed correctly.
    It's possible that the above module doesn't match the
    current version of Python, which is:
    2.7.10 (default, Jun 22 2016, 05:57:59) [C]
    If you cannot solve this problem yourself, please go to
    the yum faq at:
    http://yum.baseurl.org/wiki/Faq



    Some info about RPM pkgs
    root @res1: /opt/freeware/etc/yum $rpm -qa
    01SV860_205_165-1.1-1.noarch
    RDX.T.USB3-0278-01.noarch
    scrub-2.0-1.ppc
    nut-2.6.5-1.ppc
    readline-6.1-2.ppc
    pysqlite-1.1.7-2.ppc
    python-pycurl-7.19.3-1.ppc
    python-devel-2.7.10-1.ppc
    libgcc8-8.3.0-5.ppc
    libstdc++8-8.3.0-5.ppc
    ncurses-6.2-2.ppc
    libgomp-8-1.ppc
    libffi-3.2.1-3.ppc
    libxml2-2.9.10-1.ppc
    glib2-2.56.1-3.ppc
    info-6.7-1.ppc
    sudo_noldap-1.9.5p2-1.ppc
    libtasn1-4.16.0-1.ppc
    p11-kit-tools-0.23.22-1.ppc
    cyrus-sasl-2.1.26-3.ppc
    krb5-libs-1.18.3-1.ppc
    libssh2-1.9.0-1.ppc
    yum-3.4.3-8.noarch
    AIX-rpm-7.2.4.0-18.ppc
    rsync-3.1.2-2.ppc
    zlib-1.2.11-2.ppc
    nut-client-2.6.5-1.ppc
    popt-1.16-3.ppc
    01SV860_212_165-1.1-1.noarch
    bash-4.4-3.ppc
    gdbm-1.8.3-5.ppc
    sqlite-3.15.2-1.ppc
    python-2.7.10-1.ppc
    python-iniparse-0.4-1.noarch
    python-urlgrabber-3.10.1-1.noarch
    python-tools-2.7.10-1.ppc
    libgcc-8-1.ppc
    libstdc++-8-1.ppc
    libgomp8-8.3.0-5.ppc
    xz-libs-5.2.5-1.ppc
    libtextstyle-0.20.2-1.ppc
    libiconv-1.16-1.ppc
    gettext-0.20.2-1.ppc
    libunistring-0.9.10-1.ppc
    db-5.3.28-1.ppc
    p11-kit-0.23.22-1.ppc
    ca-certificates-2020.06.01-2.ppc
    openldap-2.4.58-1.ppc
    libnghttp2-1.41.0-1.ppc
    curl-7.76.1-1.ppc
    yum-metadata-parser-1.1.4-2.ppc









    ------------------------------
    Dharma Sanassy
    ------------------------------


  • 2.  RE: Both YUM and SUDO broke after yum install curl

    Posted Thu August 05, 2021 11:20 AM
    Can someone look into this please - Appreciate!
     
    Thanks
    Dharma / IBM







  • 3.  RE: Both YUM and SUDO broke after yum install curl

    Posted Thu August 05, 2021 12:53 PM
    I am continuing to debug this -- Last thing I did was to limit export to  :

                            root @res1:                   $export LIBPATH=/opt/freeware/lib64:/opt/freeware/lib:
                            root @res1:                 $echo $LIBPATH
                                                                  /opt/freeware/lib64:/opt/freeware/lib:
                          root @res1:                   $yum list
                                                            exec(): 0509-036 Cannot load program /opt/freeware/bin/python2 because of the following errors:
                                                             0509-150 Dependent module /opt/freeware/lib64/libpython2.7.a(libpython2.7.so) could not be loaded.
                                                            0509-103 The module has an invalid magic number.

    This resolve the following:

                               /opt/freeware/lib/libcurl.a(libcurl.so.4).
                               0509-150 Dependent module /usr/lib/libldap.a(libldap-2.4.so.2) could not be loaded.
                               0509-153 File /usr/lib/libldap.a is not an archive or






    ------------------------------
    Dharma Sanassy
    ------------------------------



  • 4.  RE: Both YUM and SUDO broke after yum install curl

    Posted Fri August 06, 2021 12:05 AM
    Please avoid setting LIBPATH. It is not a good idea.

    The real issue is you have a very old python rpm "2.7.10". Update python to one of the recent versions as it has several fixes.


    ------------------------------
    Ayappan P
    ------------------------------



  • 5.  RE: Both YUM and SUDO broke after yum install curl

    Posted Mon August 09, 2021 11:20 AM
    Thank you all - Someone mentioned to point  LIBPATH in the right order. Basically I excluded the lib64:
     
    Before
    root @res1: / $yum list
    There was a problem importing one of the Python modules
    required to run yum. The error leading to this problem was:
            0509-022 Cannot load module /opt/freeware/lib/libcurl.a(libcurl.so.4).
            0509-150   Dependent module /usr/lib/libldap.a(libldap-2.4.so.2) could not be loaded.
            0509-153   File /usr/lib/libldap.a is not an archive or
                       the file could not be read properly.
            0509-026 System error: Cannot run a file that does not have a valid format.
            0509-022 Cannot load module /opt/freeware/lib/python2.7/site-packages/pycurl.so.
            0509-150   Dependent module /opt/freeware/lib/libcurl.a(libcurl.so.4) could not be loaded.
     
    After
    root @res1: / $export LIBPATH=/opt/freeware/lib:/usr/lib:
    root @resig1: / $yum list
    AIX_Toolbox                                                                             | 2.6 kB  00:00:00     
    AIX_Toolbox_72                                                                          | 2.5 kB  00:00:00     
    AIX_Toolbox_noarch                                                                      | 2.5 kB  00:00:00     
    Installed Packages
    01SV860_205_165.noarch                                      1.1-1                            installed         
    01SV860_212_165.noarch                                      1.1-1                            installed         
    AIX-rpm.ppc                                                 7.2.4.0-20                       installed         
    RDX.T.USB3.noarch                                           0278-01                          installed         
    bash.ppc                                                    4.4-3                            installed         
    ca-certificates.ppc                                         2020.06.01-2                     @AIX_Toolbox      
    curl.ppc  
    .
    .
    .
            







  • 6.  RE: Both YUM and SUDO broke after yum install curl

    Posted Thu August 05, 2021 01:02 PM
    Hi Dharma 

    I wonder ... do you have IBM ldap installed?

    For example, I do, and it does not have libldap-2.4.so.2

    # ls -al /usr/lib/libldap.a
    lrwxrwxrwx 1 root system 35 Aug 02 20:55 /usr/lib/libldap.a -> /opt/IBM/ldap/V6.4/lib/libidsldap.a

    Maybe this is similar to the issues discovered for other non-Toolbox openldap

    https://community.ibm.com/community/user/power/communities/community-home/digestviewer/viewthread?MessageKey=5e8d49a6-6123-4816-b19f-2be995fb076d&CommunityKey=10c1d831-47ee-4d92-a138-b03f7896f7c9&tab=digestviewer#bm5e8d49a6-6123-4816-b19f-2be995fb076d

    In that case, they had to add the AIX toolbox archive to the /opt/freeware/lib because they had some other package, but in your case, maybe the freeware has to be extracted, and added to the /usr/lib/libldap.a ...

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



  • 7.  RE: Both YUM and SUDO broke after yum install curl

    Posted Fri August 06, 2021 02:32 AM
    I think updating all packages at latest level is better idea than updating individual packages. Specially when you are running very old level of packages. 
    As a first step please try to update python to latest level and then when yum started working then update packages to latest level using yum.

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