Error when trying to delete old kernel on RHEL6

Asked 2 years ago, Updated 2 years ago, 127 views

I am trying to change the number of generations held by the kernel using the package-cleanup included in the yum-utils package, but I cannot because the following error is printed normally.
Can someone tell me the solution?

OS:RHEL 6.9

execution commands:

package-cleanup --oldkernel --count=2

Error Description:

Traceback (most recent call last):
  File "/usr/bin/package-cleanup", line 27, in<module>
    from yum.misc import setup_locale
ImportError: No module named yum.misc

linux yum rhel

2022-09-30 18:00

2 Answers

I ran package-cleanup on Python 2.7, and the yum.misc required for package-cleanup was not installed for Python 2.7, so I got an error (by the way, Python 2.6. So I changed the package-cleanup to run in 2.6

to take action.


2022-09-30 18:00

Verify that the environment variable PYTHONHOME is not set to a value, and if so, try running package-cleanup again with the value empty (undefined).

unset PYTHONHOME

Note:
System fails yum with No module named yum error
Focused on Python environment variables -Bite Code


2022-09-30 18:00

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.