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
------------------------------
Original Message:
Sent: Wed August 14, 2024 03:22 AM
From: Ralph Baumann
Subject: dnf error while executing postinstall script
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
------------------------------