Open Source Development

 View Only

 ksh: rpm: 0403-006 Execute permission denied. and dnf ImportError after dnf update executed.

  • AIX Open Source
Michael Tust's profile image
Michael Tust posted Thu August 28, 2025 12:13 PM

#
# Summary of issue:
#

Upgraded from  AIX 7.2.5.4 to 7.3.3.1 - attempting to upgrade rpm's on my server.
root # oslevel -s
7300-03-01-2520

After performing dnf update --exclude=perl --allowerasing
I see the following errors when trying to execute the rpm command:
"ksh: rpm: 0403-006 Execute permission denied."


And when attempting to issue dnf commands
/opt/freeware/bin/dnf list
error: Unable to open /usr/opt/rpm/lib/rpm/rpmrc for reading: m.
Traceback (most recent call last):
  File "/opt/freeware/bin/dnf", line 58, 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 31, in <module>
    from dnf.comps import CompsQuery
  File "/opt/freeware/lib/python3.9/site-packages/dnf/comps.py", line 27, in <module>
    from dnf.exceptions import CompsError
  File "/opt/freeware/lib/python3.9/site-packages/dnf/exceptions.py", line 22, in <module>
    import dnf.util
  File "/opt/freeware/lib/python3.9/site-packages/dnf/util.py", line 30, in <module>
    import dnf.callback
  File "/opt/freeware/lib/python3.9/site-packages/dnf/callback.py", line 22, in <module>
    import dnf.yum.rpmtrans
  File "/opt/freeware/lib/python3.9/site-packages/dnf/yum/rpmtrans.py", line 26, in <module>
    import rpm
  File "/opt/freeware/lib64/python3.9/site-packages/rpm/__init__.py", line 39, in <module>
    from rpm.transaction import *
  File "/opt/freeware/lib64/python3.9/site-packages/rpm/transaction.py", line 5, in <module>
    from rpm._rpm import ts as TransactionSetCore
ImportError: cannot import name 'ts' from 'rpm._rpm' (/opt/freeware/lib64/python3.9/site-packages/rpm/_rpm.so)

lslpp -l rpm.rte
  Fileset                      Level  State      Description         
  ----------------------------------------------------------------------------
Path: /usr/lib/objrepos
  rpm.rte                4.18.1.2005  COMMITTED  RPM Package ManagerPath: /etc/objrepos
  rpm.rte                4.18.1.2005  COMMITTED  RPM Package Manager


##
## Detailed information to install dnf_aixtoolbox.local.sh
##

Had to do a bunch of stuff to get dnf working on 7.3.3.1:

lslpp -l rpm.rte
  Fileset                      Level  State      Description         
  ----------------------------------------------------------------------------
Path: /usr/lib/objrepos
  rpm.rte                4.18.1.2005  COMMITTED  RPM Package ManagerPath: /etc/objrepos
  rpm.rte                4.18.1.2005  COMMITTED  RPM Package Manager

rpm -ev libstdc++-devel libstdc++ libffi   gcc-c++ gcc-cpp gcc glib2 curl pkg-config libgcc openssl openldap libssh2 sudo-1.8.22-1.ppc  gnupg-1.4.22-1.ppc

rpm -ev libtool automake autoconf

rpm -ivh /mnt/RPMS/ppc-7.3/libgcc10-10.3.0-6.aix7.3.ppc.rpm
warning: /mnt/RPMS/ppc-7.3/libgcc10-10.3.0-6.aix7.3.ppc.rpm: Header V4 RSA/SHA256 Signature, key ID 41eea8e0: NOKEY
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:libgcc10-10.3.0-6                ################################# [100%]

ln -s /opt/freeware/lib/gcc/powerpc-ibm-aix7.3.0.0/10/libgcc_s.a  /opt/freeware/lib/libgcc_s.a 

rpm -ivh /mnt/RPMS/ppc-7.3/libstdc++10-10.3.0-6.aix7.3.ppc.rpm /mnt/RPMS/ppc-7.3/libstdc++10-devel-10.3.0-6.aix7.3.ppc.rpm

warning: /mnt/RPMS/ppc-7.3/libstdc++10-10.3.0-6.aix7.3.ppc.rpm: Header V4 RSA/SHA256 Signature, key ID 41eea8e0: NOKEY
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:libstdc++10-10.3.0-6             ################################# [ 50%]
   2:libstdc++10-devel-10.3.0-6       ################################# [100%]


ln -s /opt/freeware/lib/gcc/powerpc-ibm-aix7.3.0.0/10/libstdc++.a /opt/freeware/lib/libstdc++.a 

##
## After doing this I was able to install dnf and issue commands to upgrade from the ISO:
##
root # /mnt/ezinstall/ppc/dnf_aixtoolbox_local.sh /mnt

Copying dnf_bundle_aix_73.tar to /tmp/dnf-20250827143057 ..... 

Extracting dnf_bundle_aix_73.tar ...
x ca-certificates-2023.2.60-0.aix7.1.ppc.rpm, 991206 bytes, 1936 tape blocks
x dnf-4.2.17-64_7.aix7.1.noarch.rpm, 11496 bytes, 23 tape blocks
x dnf-automatic-4.2.17-64_7.aix7.1.noarch.rpm, 12956 bytes, 26 tape blocks
x dnf-data-4.2.17-64_7.aix7.1.noarch.rpm, 29804 bytes, 59 tape blocks

<redacted> 

  32:gnupg2-2.2.35-0                  ################################# [100%]

dnf installed successfully. 
Please run 'dnf update' to update packages to the latest level. 

Please note, RPM packages are downloaded in dnf cache /var/cache/dnf.
RPM packages install files go under the path /opt.
Hence it is recommended to always keep at least 512MB of free space in /var & /opt
to avoid any download and installation/update failures.

Creating the dnf.conf file with required locale repositories.
The default /opt/freeware/etc/dnf/dnf.conf has been saved as /opt/freeware/etc/dnf/dnf.conf_local_bak


/opt/freeware/bin/dnf repolist
repo id                                                                                                     repo name
Local_AIX_Toolbox                                                                                           Local AIX generic repository
Local_AIX_Toolbox_73                                                                                        Local AIX 7.3 specific repository
Local_AIX_Toolbox_noarch                                                                                    Local AIX noarch repository

/opt/freeware/bin/dnf update --exclude=perl
Last metadata expiration check: 0:21:45 ago on Wed Aug 27 14:36:14 CDT 2025.
Error: 
 Problem 1: cannot install both bash-5.2.21-1.ppc and bash-4.2-5.ppc
  - package rpm-build-3.0.5-52.ppc requires /bin/bash2, but none of the providers can be installed
  - cannot install the best update candidate for package bash-4.2-5.ppc
  - problem with installed package rpm-build-3.0.5-52.ppc
 Problem 2: cannot install both popt-1.19-1.ppc and popt-1.16-1.ppc
  - package rpm-3.0.5-52.ppc requires libpopt.so, but none of the providers can be installed
  - cannot install the best update candidate for package popt-1.16-1.ppc
  - problem with installed package rpm-3.0.5-52.ppc
 Problem 3: cannot install both popt-1.19-1.ppc and popt-1.16-1.ppc
  - package rpm-3.0.5-52.ppc requires libpopt.so, but none of the providers can be installed
  - package logrotate-3.21.0-1.ppc requires popt >= 1.19, but none of the providers can be installed
  - package rpm-devel-3.0.5-52.ppc requires rpm = 3.0.5, but none of the providers can be installed
  - cannot install the best update candidate for package logrotate-3.7.9-2.ppc
  - problem with installed package rpm-devel-3.0.5-52.ppc
(try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

root # /opt/freeware/bin/dnf update --exclude=perl --allowerasing
Last metadata expiration check: 0:27:23 ago on Wed Aug 27 14:36:14 CDT 2025.
Dependencies resolved.

<redacted output>

Upgraded:
  bash-5.2.21-1.ppc                   bash-doc-5.2.21-1.ppc              binutils-2.44-1.ppc                   bison-3.8.2-3.ppc                     bzip2-1.0.8-2.ppc                    ca-certificates-2024.2.66-2.ppc    
  coreutils-9.5-1.ppc                 cpio-2.15-1.ppc                    diffutils-3.10-1.ppc                  expect-5.45.4-2.ppc                   flex-2.6.4-2.ppc                     gawk-5.2.2-1.ppc                   
  gdb-15.2-1.ppc                      gettext-0.21-2.ppc                 gmp-6.3.0-1.ppc                       gnupg2-2.4.7-1.ppc                    grep-3.7-2.ppc                       gzip-1.12-3.ppc                    
  info-7.2-1.ppc                      libcomps-0.1.15-101.ppc            libiconv-1.17-1.ppc                   libmodulemd-1.5.2-100.ppc             librepo-1.11.0-103.ppc               libsmartcols-2.34-101.ppc          
  libzstd-1.5.2-3.ppc                 logrotate-3.21.0-1.ppc             m4-1.4.19-1.ppc                       make-1:4.4.1-1.ppc                    p11-kit-0.25.5-2.ppc                 p11-kit-tools-0.25.5-2.ppc         
  patch-2.8-1.ppc                     pcre-8.44-2.ppc                    popt-1.19-1.ppc                       python3-3.9.22-1.ppc                  python3-gpg-1.13.1-101.ppc           python3-libcomps-0.1.15-101.ppc    
  python3-librepo-1.11.0-103.ppc      python3.9-3.9.22-1.ppc             python3.9-gpg-1.13.1-101.ppc          python3.9-libcomps-0.1.15-101.ppc     python3.9-librepo-1.11.0-103.ppc     readline-8.2-1.ppc                 
  rsync-3.4.1-2.ppc                   sed-4.9-1.ppc                      tar-1.35-2.ppc                        tcl-8.6.13-1.ppc                      tk-8.6.13-1.ppc                      unzip-6.0-4.ppc                    
  vim-common-9.1.1355-2.ppc           vim-minimal-9.1.1355-2.ppc         zchunk-libs-1.1.4-103.ppc             zip-3.0-4.ppc                         zlib-1.2.13-1.ppc                    dnf-4.2.17-64_55.ppc               
  dnf-automatic-4.2.17-64_55.ppc      dnf-data-4.2.17-64_55.ppc          libdnf-0.39.1-64_52.ppc               libsolv-0.7.9-64_52.ppc               python3-dnf-4.2.17-64_55.ppc         python3-hawkey-0.39.1-64_52.ppc    
  python3-libdnf-0.39.1-64_52.ppc     python3.9-dnf-4.2.17-64_55.ppc     python3.9-hawkey-0.39.1-64_52.ppc     python3.9-libdnf-0.39.1-64_52.ppc    

Installed:
  pinentry-1.0.0-1.ppc         cairo-1.18.0-1waixX11.ppc        check-0.13.0-1.ppc       curl-8.14.1-1.ppc        cyrus-sasl-2.1.28-1.ppc    db-1:5.3.28-1.ppc          expat-2.6.3-1.ppc         fontconfig-2.14.2-1.ppc   
  freetype2-2.13.3-1.ppc       gdbm-1.23-1.ppc                  glib2-2.83.2-1.ppc       gnutls-3.8.7-1.ppc       gpgme-1.13.1-101.ppc       harfbuzz-7.1.0-1.ppc       json-c-0.17-1.ppc         krb5-libs-1.21.3-3.ppc    
  libXft-2.3.2-5waixX11.ppc    libXrender-0.9.8-3waixX11.ppc    libassuan-2.5.6-1.ppc    libffi-3.4.4-2.ppc       libgcrypt-1.10.3-1.ppc     libgpg-error-1.49-1.ppc    libksba-1.6.3-1.ppc       libnghttp2-1.62.1-1.ppc   
  libpng-1.6.42-1.ppc          libsodium-1.0.19-1.ppc           libssh2-1.11.0-1.ppc     libtasn1-4.19.0-1.ppc    libtextstyle-0.21-2.ppc    libunistring-1.1-1.ppc     libxml2-2.12.9-1.ppc      libyaml-0.2.5-1.ppc       
  lz4-1.9.4-1.ppc              lzo-2.10-3.ppc                   mpfr-4.2.1-1.ppc         ncurses-6.5-1.ppc        nettle-3.10.1-1.ppc        npth-1.5-1.ppc             openldap-2.5.16-3.ppc     pcre2-10.45-2.ppc         
  pixman-0.42.2-1.ppc          sqlite-3.49.2-1.ppc              xz-libs-5.8.1-1.ppc      libgcc-1:13-1.ppc        libgcc13-13.3.0-1.ppc      libgomp-1:13-1.ppc         libgomp13-13.3.0-1.ppc    libstdc++-1:13-1.ppc      
  libstdc++13-13.3.0-1.ppc    

Removed:
  rpm-3.0.5-52.ppc                                                      rpm-build-3.0.5-52.ppc                                                      rpm-devel-3.0.5-52.ppc                                                     

Immediately following the dnf update:

root # rpm -qa
ksh: rpm: 0403-006 Execute permission denied.
    
root # /opt/freeware/bin/dnf list
error: Unable to open /usr/opt/rpm/lib/rpm/rpmrc for reading: m.
Traceback (most recent call last):
  File "/opt/freeware/bin/dnf", line 58, 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 31, in <module>
    from dnf.comps import CompsQuery
  File "/opt/freeware/lib/python3.9/site-packages/dnf/comps.py", line 27, in <module>
    from dnf.exceptions import CompsError
  File "/opt/freeware/lib/python3.9/site-packages/dnf/exceptions.py", line 22, in <module>
    import dnf.util
  File "/opt/freeware/lib/python3.9/site-packages/dnf/util.py", line 30, in <module>
    import dnf.callback
  File "/opt/freeware/lib/python3.9/site-packages/dnf/callback.py", line 22, in <module>
    import dnf.yum.rpmtrans
  File "/opt/freeware/lib/python3.9/site-packages/dnf/yum/rpmtrans.py", line 26, in <module>
    import rpm
  File "/opt/freeware/lib64/python3.9/site-packages/rpm/__init__.py", line 39, in <module>
    from rpm.transaction import *
  File "/opt/freeware/lib64/python3.9/site-packages/rpm/transaction.py", line 5, in <module>
    from rpm._rpm import ts as TransactionSetCore
ImportError: cannot import name 'ts' from 'rpm._rpm' (/opt/freeware/lib64/python3.9/site-packages/rpm/_rpm.so)

Thanks for your feedback, Michael Tust


#AIXOpenSource
Michael Tust's profile image
Michael Tust

Thanks to a suggestion from our  IBM Power Premium - AIX Technical Account Manager
We were able to get by the:

# rpm -qa

ksh: rpm: 0403-006 Execute permission denied.
Issue by force installing rpm.rte: 

cd /LPP_Source_7.3.3.1/installp/ppc

installp -acFNXYd . rpm.rte

The rpm command now works. 

Now new issues exist:
root # /opt/freeware/bin/dnf repolist
exec(): 0509-036 Cannot load program /opt/freeware/bin/python3.9 because of the following errors:
        0509-130 Symbol resolution failed for /opt/freeware/lib64/libpython3.9.a[libpython3.9.so] because:
        0509-136   Symbol _GLOBAL__AIXI_libintl_so (number 286) is not exported from
                   dependent module /usr/opt/rpm/lib/libintl.a[libintl.so.8].
        0509-136   Symbol _GLOBAL__AIXD_libintl_so (number 287) is not exported from
                   dependent module /usr/opt/rpm/lib/libintl.a[libintl.so.8].
        0509-192 Examine .loader section symbols with the
                 'dump -Tv' command.

Going down the rabbit hole on this:

root # rpm -qa | grep gettext

gettext-0.21-2.ppc

 

root # rpm -e --nodeps gettext-0.21-2.ppc

 

root # rpm

RPM version 4.18.1

 

root # /opt/freeware/bin/dnf repolist

exec(): 0509-036 Cannot load program /opt/freeware/bin/python3.9 because of the following errors:

        0509-022 Cannot load module /opt/freeware/lib/libpython3.9.a(libpython3.9.so).

        0509-150   Dependent module /opt/freeware/lib/libintl.a(libintl.so.8) could not be loaded.

        0509-022 Cannot load module /opt/freeware/lib/libintl.a(libintl.so.8).

 

root # find /mnt | grep gettext

/mnt/RPMS/ppc/gettext-0.21-2.aix7.1.ppc.rpm

/mnt/RPMS/ppc/gettext-devel-0.21-2.aix7.1.ppc.rpm

/mnt/RPMS.bygroup/ppc/Development/Tools/gettext-0.21-2.aix7.1.ppc.rpm

/mnt/RPMS.bygroup/ppc/Development/Tools/gettext-devel-0.21-2.aix7.1.ppc.rpm

/mnt/ezinstall/ppc/base/gettext-0.21-2.aix7.1.ppc.rpm

uxtst103:/opt/toolbox/rubrik

root # rpm -ivh /mnt/RPMS/ppc/gettext-0.21-2.aix7.1.ppc.rpm

Verifying...                          ################################# [100%]

Preparing...                          ################################# [100%]

Updating / installing...

   1:gettext-0.21-2                   ################################# [100%]

 

 

 

 

root # /opt/freeware/bin/dnf repolist                     

Traceback (most recent call last):

  File "/opt/freeware/bin/dnf", line 58, 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/lib64/python3.9/site-packages/libdnf/__init__.py", line 3, in <module>

    from . import common_types

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

    from . import _common_types

ImportError:    0509-130 Symbol resolution failed for /opt/freeware/lib64/libsolv.a[libsolv.so.1] because:

        0509-136   Symbol _GLOBAL__AIXI_libbz2_so (number 61) is not exported from

                   dependent module /usr/opt/rpm/lib/libbz2.a[libbz2.so.1].

        0509-136   Symbol _GLOBAL__AIXD_libbz2_so (number 62) is not exported from

                   dependent module /usr/opt/rpm/lib/libbz2.a[libbz2.so.1].

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

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

        0509-192 Examine .loader section symbols with the

                 'dump -Tv' command.

 

 

 

 

root # ar -X32_64 -tv /usr/opt/rpm/lib/libbz2.a

rwxr-xr-x     0/0      93214 Jun 19 10:02 2023 libbz2.so.1

rwxr-xr-x     0/0     101085 Jun 19 10:02 2023 libbz2.so.1

 

 

root # rpm -qf /usr/opt/rpm/lib/libbz2.a

file /usr/opt/rpm/lib/libbz2.a is not owned by any package

 

 

 

root # lslpp -w /usr/opt/rpm/lib/libbz2.a

  File                                        Fileset               Type

  ----------------------------------------------------------------------------

  /usr/opt/rpm/lib/libbz2.a                   rpm.rte               File




#AIXOpenSource
SANGAMESH MALLAYYA's profile image
SANGAMESH MALLAYYA

Hi Michael,

The problem is caused due to very older rpm packages of rpm installed in the system.

Very long back we stopped updating rpm packages for rpm and everything is update through rpm.rte fileset.

Anyway, to resolve current DNF error.  I would suggest to remove all the installed rpm packages if no issue in doing that,

and then running the dnf_aixtoolbox_local.sh script one more time.


#AIXOpenSource