Yum not working after upgrade from CentOS 7.x to Alma 8.9

Hi, I recently upgraded from centOS7 to almalinux using the elevate guide. I have run into some problems with yum.
When i run yum update. I got an error which i had to use python2 to resolve unfortunately I get this new error message.

There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

   /lib64/liblzma.so.5: version `XZ_5.1.2alpha' not found (required by /lib64/librpmio.so.3)

Please install a package which provides this module, or
verify that the module is installed correctly.

It's possible that the above module doesn't match the
current version of Python, which is:
2.7.18 (default, Nov 15 2023, 10:00:57) 
[GCC 8.5.0 20210514 (Red Hat 8.5.0-20)]

If you cannot solve this problem yourself, please go to 
the yum faq at:
  http://yum.baseurl.org/wiki/Faq

Stomped at how to proceed. This is my first experience really using a linux machine(VPS).

Update: Due to urgency I had to reinstall almalinux directly from the vps hosting panel and restore backups.

I would still like to learn if there was a solution to this.

Thank you

First a disclaimer: I have never used ELevate nor tried in-place conversion by other means. I did consider use of ELevate once … almost seriously.

  • The yum in AlmaLinux 8 is a mere symlink to dnf and dnf is a Python 3.6 application
  • The AlmaLinux 8 does not have Python 2.7 by default. There is a stream for it, supported up to next June. I don’t know whether ELevate installs that stream – logically it should not

Therefore, if ‘yum’ had an error, then conversion was incomplete and python2 should not have been a proper “solution” in the first place.

1 Like