AIX

 View Only
Expand all | Collapse all

Broken package in AIX 7.2

  • 1.  Broken package in AIX 7.2

    Posted Thu January 18, 2024 06:48 AM
    Edited by Robert Kampermann Fri January 26, 2024 04:26 AM

    Problem ist solved, is it possible to close a posting for comments?

    I installed dnf from the toolbox image availible on ESS (ESD-Toolbox_for_Linux_Apps_Common_7.1-7.3_112023_LKT010326.tar.gz)

    on a lpar running AIX 7200-05-05-2246

    Goal is to install packages with ansible using dnf.

    That fails with a fatal error:

    fatal: [lpar23-7255]: FAILED! => {"changed": false, "msg": "`python3-dnf` is not installed, but it is requiredfor the Ansible dnf module.", "results": []}

    the package python-dnf 3 is installed: 

    #rpm -qa | grep python3-dnf

    python3-dnf-4.2.17-32_51.ppc

    If we want to import the dnf module into python3 we get an error:

    #/opt/freeware/bin/python3

    Python 3.9.18 (main, Sep 19 2023, 04:57:07)

    [GCC 10.3.0] on aix

    Type "help", "copyright", "credits" or "license" for more information.

    >>> import dnf

    Traceback (most recent call last):

      File "<stdin>", line 1, in <module>

      File "/opt/freeware/lib/python3.9/site-packages/dnf/__init__.py", line 32, in <module>

        import dnf.base

      File "/opt/freeware/lib/python3.9/site-packages/dnf/base.py", line 29, in <module>

        import libdnf.transaction

      File "/opt/freeware/lib/python3.9/site-packages/libdnf/__init__.py", line 3, in <module>

        from . import common_types

      File "/opt/freeware/lib/python3.9/site-packages/libdnf/common_types.py", line 13, in <module>

        from . import _common_types

    ImportError:    0509-022 Cannot load module /opt/freeware/lib/python3.9/site-packages/libdnf/_common_types.so.

            0509-026 System error: Cannot run a file that does not have a valid format.

    The .so-file got delivered from the following package:

    # rpm -qf /opt/freeware/lib/python3.9/site-packages/libdnf/_common_types.so

    python3.9-libdnf-0.39.1-32_52.ppc

    What is wrong there?

    We have a lpar installed with 7300-02-01-2346 and the same toolbox image from above and it works fine, only difference, it is using python3.9-libdnf-0.39.1-64_52.ppc



    ------------------------------
    Robert Kampermann
    ------------------------------



  • 2.  RE: Broken package in AIX 7.2

    IBM Champion
    Posted Fri January 19, 2024 07:46 AM

    Hi Robert,

    if you would ask your question in AIX Open Source community, you'd get your answer faster ;-)

    It is not broken, "it works as designed" (c) ;-) The reason for this design is not known for me, but if you use Ansible to install DNF packages (and it looks like, otherwise you wouldn't get the message), you should use 32-bit python on AIX 7.2.

    Set specific ansible_python_interpreter for the task:

    ---
    - name: Install DNF packages on AIX
      hosts: all
      gather_facts: true
      vars:
        package: httpd
    
      tasks:
      - name: Install packages on AIX 7.2
        ansible.builtin.dnf:
          name: "{{ package }}"
          use_backend: dnf4
        vars:
          ansible_python_interpreter: /opt/freeware/libexec/python3.9_32
        when: ansible_facts.distribution_version == '7.2'
      - name: Install packages on AIX 7.3
        ansible.builtin.dnf:
          name: "{{ package }}"
          use_backend: dnf4
        vars:
          ansible_python_interpreter: /opt/freeware/bin/python3.9
        when: ansible_facts.distribution_version == '7.3'
    


    ------------------------------
    Andrey Klyachkin

    https://www.power-devops.com
    ------------------------------