0

I am facing one problem while running yum command. While runnning yum command I am getting below error:

-bash: /usr/bin/yum: /usr/libexec/platform-python: bad interpreter: No such file or directory. 

While running subscription-manager, it is giving below error:

ModuleNotFoundError: No module named 'pkg_resources' 

I changes which I made is to remove the python3.6 file. python3.11 is currently install on server and i am able to use python3 without any issue.

Is there any configuration by which I can point yum/subscription-manager to python3.11 and resolve this issue?

Thank You

1 Answer 1

4

You broke your system. You cannot just remove the system Python interpreter and hope python programs will continue to work!

So, you need to roll back (ideally, you have backups – that might be the quickest route) your deletion of the python3.6 interpreter. You cannot just use "any" python3.6, it needs to be exactly the one compiled for your RHEL.

Whatever you were trying to achieve by deleting python3.6, you should never remove parts of your system installation directly, but let the package manager handle that. That's yum's job – allowing you to safely remove and install software. In this case, trying to uninstall that version of Python would have failed, because yum would have correctly told you that you'd be uninstalling a critical part of the system.

I don't know what the motivation for removing python3.6 was, but you probably should read into how you can build python-version-specific environments with the version of python you want to use, instead of uninstalling other versions.

5
  • I agree with your comment. If I am reverting the changes which I made, I am able to run yum command and other stuff. The strange thing for me is that, I am using RHEL 8.10 and python version is python3.11. We observed vulnerability for python3.6. Ideally python should be upgraded along with OS patching but in my case, I can see python3.6 as well. While running python command it is taking python3.11 then why yum is looking for python3.6? Is there any yum configuration which needs to be updated? Commented Dec 18, 2024 at 16:45
  • if your operating system is still in support, security patches would be available through yum. You can't patch these things (in general) without breaking your system. Commented Dec 18, 2024 at 16:47
  • no, as said, there's no yum configuration to be updated. As demonstrated, your yum (which is actually just an alias to dnf, by the way) uses Python3.6, and that's fixed. Commented Dec 18, 2024 at 16:47
  • Thanks Marcus. reviewing access.redhat.com/solutions/6879401, it seems that python3.6 is completely removed in RHEL 9. So if I understand correctly, we need to migrate our application from RHEL 8.10 to 9.x and there is no other option. Please let me know your thoughts. Commented Dec 18, 2024 at 17:10
  • my thoughts: you don't really seem to read what I write. I said: if there's a security issue with Python3.6 in your still-supported RHEL, then Redhat will supply you with a fix. (if it's not supported anymore, then you're running unsafe anyways). Commented Dec 18, 2024 at 17:11

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.