LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions
User Name
Password
Linux - Distributions This forum is for Distribution specific questions.
Red Hat, Slackware, Debian, Novell, LFS, Mandriva, Ubuntu, Fedora - the list goes on and on... Note: An (*) indicates there is no official participation from that distribution here at LQ.

Notices


Reply
  Search this Thread
Old 08-02-2023, 10:54 AM   #1
hasn318
LQ Newbie
 
Registered: Aug 2023
Posts: 4

Rep: Reputation: 0
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'
 
Old 08-02-2023, 10:56 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,852

Rep: Reputation: 7310Reputation: 7310Reputation: 7310Reputation: 7310Reputation: 7310Reputation: 7310Reputation: 7310Reputation: 7310Reputation: 7310Reputation: 7310Reputation: 7310
did you make any changes on that system? Probably you need to reinstall python and some packages.
 
Old 08-02-2023, 11:16 AM   #3
hasn318
LQ Newbie
 
Registered: Aug 2023
Posts: 4

Original Poster
Rep: Reputation: 0
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
 
Old 08-02-2023, 11:23 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by hasn318 View Post
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?
 
Old 08-02-2023, 11:40 AM   #5
hasn318
LQ Newbie
 
Registered: Aug 2023
Posts: 4

Original Poster
Rep: Reputation: 0
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.
 
Old 08-02-2023, 11:58 AM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by hasn318 View Post
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.
 
Old 08-02-2023, 12:06 PM   #7
hasn318
LQ Newbie
 
Registered: Aug 2023
Posts: 4

Original Poster
Rep: Reputation: 0
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.
 
Old 08-02-2023, 12:16 PM   #8
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by hasn318 View Post
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?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: The Difference Between DNF and YUM, Why is Yum Replaced by DNF? LXer Syndicated Linux News 0 02-03-2020 02:02 PM
[SOLVED] Fedora, updating notices and packages : dnf updateinfo & dnf check-update fanoflq Linux - Newbie 9 05-20-2017 07:07 PM
LXer: DNF (Dandified yum), the next generation of yum package manager (Fork of Yum) for Fedora system LXer Syndicated Linux News 0 08-07-2016 05:12 PM
[SOLVED] dnf remove repo, dnf command help ? mshlinux Fedora 2 10-01-2015 10:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions

All times are GMT -5. The time now is 02:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration