LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Distributions (https://www.linuxquestions.org/questions/linux-distributions-5/)
-   -   yum/dnf broken (https://www.linuxquestions.org/questions/linux-distributions-5/yum-dnf-broken-4175727636/)

hasn318 08-02-2023 10:54 AM

yum/dnf broken
 
No yum/dnf commands works on RHEL 8 EC2 instance. Whatever yum/dnf command I run, I get the below error. Any help would be appreciated
yum
Traceback (most recent call last):
File "/usr/bin/yum", line 57, in
from dnf.cli import main
File "/usr/lib/python3.6/site-packages/dnf/init.py", line 22, in
import warnings
ImportError: bad magic number in 'warnings': b'a\r\r\n'

pan64 08-02-2023 10:56 AM

did you make any changes on that system? Probably you need to reinstall python and some packages.

hasn318 08-02-2023 11:16 AM

It gets automated patching i.e. yum update -y on a monthly basis. I strongly believe I am not able to use yum/dnf after the automated patching. Is there a way to fix the python

TB0ne 08-02-2023 11:23 AM

Quote:

Originally Posted by hasn318 (Post 6445827)
No yum/dnf commands works on RHEL 8 EC2 instance. Whatever yum/dnf command I run, I get the below error. Any help would be appreciated
Code:

yum
Traceback (most recent call last):
File "/usr/bin/yum", line 57, in
from dnf.cli import main
File "/usr/lib/python3.6/site-packages/dnf/init.py", line 22, in
import warnings
ImportError: bad magic number in 'warnings': b'a\r\r\n'


...and....
Quote:

Originally Posted by hasn318
It gets automated patching i.e. yum update -y on a monthly basis. I strongly believe I am not able to use yum/dnf after the automated patching. Is there a way to fix the python

If that's what you believe, then have you contacted your host or Red Hat support for help?? If the automated patching does this, then it's broken something and you should utilize the support you paid for.

Another alternative would be that someone else updated something manually, which broke python. Have they?

hasn318 08-02-2023 11:40 AM

It is hosted through AWS and we do not have enterprise support for it. I have quite a few servers with the same exact issue so I highly doubt someone did something to break it.

TB0ne 08-02-2023 11:58 AM

Quote:

Originally Posted by hasn318 (Post 6445840)
It is hosted through AWS and we do not have enterprise support for it. I have quite a few servers with the same exact issue so I highly doubt someone did something to break it.

Ah, then my question would go to Amazon AWS. If all your instances are having the same issue, then they may have pushed something out in error.

hasn318 08-02-2023 12:06 PM

Not all the instances, 7 out of 30 plus have this issue. The others are running fine. My primary goal right now is to fix the system rather than finding out what broke it. Will do the RCA after the fix.

TB0ne 08-02-2023 12:16 PM

Quote:

Originally Posted by hasn318 (Post 6445847)
Not all the instances, 7 out of 30 plus have this issue. The others are running fine. My primary goal right now is to fix the system rather than finding out what broke it. Will do the RCA after the fix.

Providing full details is a good thing.

Have you done any troubleshooting thus far?? Run "python --version" on the machines to see what comes up?


All times are GMT -5. The time now is 02:39 PM.