When running "yum" utility on a Greenplum host, it reports the following error:
[root@mdw gpadmin]# yum list
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:
No module named yum
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)]
If you cannot solve this problem yourself, please go to
the yum faq at:
http://yum.baseurl.org/wiki/Faq
[root@mdw gpadmin]#
Greenplum all versions
This is usually caused by environment variables set by the Greenplum file "${GPHOME}/greenplum_path.sh.
yum utility is a python script and needs to use the python installed on the host and avoid the use of the python delivered with Greenplum.
The Greenplum file ${GPHOME}/greenplum_path.sh sets PYTHONHOME, PYTHONPATH and LD_LIBRARY_PATH which can stop the yum utility from running.
When switching user to root use "su -" and not just "su".
"su -" will clear the Greenplum environment variables and source the "root" user environment to allow yum to run.
If the Greenplum environment was sourced, clear the settings for PYTHONHOME, PYTHONPATH and LD_LIBRARY_PATH
unset PYTHONHOME
unset PYTHONPATH
unset LD_LIBRARY_PATH