CentOS 7: yum fails importing required Python module liblzma

I’m accessing a machine with CentOS Linux 7.9.2009, Python 2.7.5, and GCC 10.3.0 (the choice of python2 was not mine). I’m trying to install an rpm through the yum command, but got this error message:

[cevangel@lxplus760 ~]$ yum install https://ecsft.cern.ch/dist/cvmfs/cvmfs-release/cvmfs-release-3-2.src.rpm
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

   /cvmfs/cms.cern.ch/el8_amd64_gcc10/cms/cmssw-patch/CMSSW_12_5_2_patch1/external/el8_amd64_gcc10/lib/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.5 (default, Jun 28 2022, 15:30:04) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]

Every time I use the yum command I got this same error, so I’m not able to install the xz module.

I would appreciate any help.

Read more here: Source link