AIX

 View Only

 dnf error inside NIM client alt_disk_install script

Matthew Opoka's profile image
Matthew Opoka posted Wed January 14, 2026 11:53 AM

I'm getting the error below when calling dnf inside a script while running a nim alt_disk_install to a nim client.  Any ideas?

Running user specified customization script /tmp/_nim_dir_61081420/script...
Traceback (most recent call last):
  File "/opt/freeware/bin/dnf", line 57, in <module>
    from dnf.cli import main
  File "/opt/freeware/lib/python3.9/site-packages/dnf/__init__.py", line 30, 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-150   Dependent module /usr/lib/libiconv.a(libiconv.so.2) could not be loaded.
        0509-152   Member libiconv.so.2 is not found in archive
        0509-022 Cannot load module /opt/freeware/lib/python3.9/site-packages/libdnf/_common_types.so.
        0509-150   Dependent module /opt/freeware/lib/python3.9/site-packages/libdnf/_common_types.so could not be loaded.

Anas AlSaleh's profile image
Anas AlSaleh

Hi

During the alt_disk_install script phase, the environment often has LIBPATH set wrong.

So AIX loads libiconv from /usr/lib/libiconv.a (wrong place / wrong member), instead of the Toolbox libraries under /opt/freeware.

Try below

**put this before running dnf***

unset LIBPATH

/opt/freeware/bin/dnf <your-command>

=====================================

** If you must set LIBPATH ***

Force Toolbox libraries first:

export LIBPATH=/opt/freeware/lib:/opt/freeware/lib64:/usr/lib:/lib

/opt/freeware/bin/dnf <your-command>

======================================

way to confirm

Add this line right before dnf in your script:

echo "LIBPATH=$LIBPATH"

If it shows /usr/lib (or doesn’t include /opt/freeware/lib), that’s the reason for the failure.