DNF ImportError: /usr/lib64/libdnf.so.2: undefined symbol:

Hello,

  • OpenMandriva Lx version:
    Rolling

  • Desktop environment (KDE, LXQT…):
    Command line (server) though there may be some X11 stuff

  • Description of the issue (screenshots if relevant):
    Since a recent update, DNF doesn’t work anymore:

Traceback (most recent call last):
  File "/usr/bin/dnf", line 61, in <module>
    from dnf.cli import main
  File "/usr/lib/python3.11/site-packages/dnf/__init__.py", line 30, in <module>
    import dnf.base
  File "/usr/lib/python3.11/site-packages/dnf/base.py", line 29, in <module>
    import libdnf.transaction
  File "/usr/lib64/python3.11/site-packages/libdnf/__init__.py", line 12, in <module>
    from . import conf
  File "/usr/lib64/python3.11/site-packages/libdnf/conf.py", line 13, in <module>
    from . import _conf
ImportError: /usr/lib64/libdnf.so.2: undefined symbol: modulemd_module_stream_v2_get_demodularized_rpms
  • Relevant informations (hardware involved, software version, logs or output…):

omv-bug-reports output.

Hi @raphael. Just a guess. Perhaps download and install this with rpm?

Edit: But your omv-bug-report output shows lib64dnf2-0.69.0-1.x86_64 as installed. I’ll look some more but this may need a developer. But this looks like some package did not finish during the upgrade.

Hi @ben79 , I’ve already removed and reinstalled dnf and all dependencies (including this one) directly from mirror repos, using rpm command.
I still have the same message…

Hi @raphael,

modulemd_module_stream_v2_get_demodularized_rpms is from /usr/lib64/libmodulemd.so.2 which is provided by lib64modulemd. So you may check if this library is effectively linked by libdnf.so:

ldd  /usr/lib64/libdnf.so.2

or reinstall lib64modulemd from rpm.

Also there are some other errors make me as @ben79 there is something broken

mirror crond[13632]: PAM unable to dlopen(/lib64/security/pam_unix.so): /lib64/libc.so.6: version `GLIBC_ABI_DT_RELR' not found (required by /usr/lib64/libpthread.so.0)
mirror crond[13632]: PAM adding faulty module: /lib64/security/pam_unix.so
mirror crond[13632]: PAM unable to dlopen(/lib64/security/pam_systemd.so): /lib64/libc.so.6: version `GLIBC_ABI_DT_RELR' not found (required by /usr/lib64/libm.so.6)
mirror crond[13632]: PAM adding faulty module: /lib64/security/pam_systemd.so
1 Like

Hi @mandian,

Before I saw your repy, I tried to use zypper and it went well until went very bad: all was borked, all commands were failing (even simple like grep, rpm etc). At least I could revert to a backup I made just before.
I made the mistake not updating the server since January 2021 (the release was 4.2 at that time) because all was running smoothly. As it was a rolling, the update gap was certainly too big.

From the backup I made an upgrade to rock 4.3 and this time all has been working perfectly.

Thanks for this tip with ldd, I did not know, I’ll keep it.