Advertisement

02.25.2008 at 05:43AM PST, ID: 23190143
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

How to install yum on RedHat Linux 7.3 (Valhalla)

Tags: ImportError: Bad magic number in /usr/share/yum/yummain.pyc
Hi Everyone,

I have installed yum on Redhat 7.3 but when ever I do yum check-update or yum update I get the error below.I have googled this error but cant find a proper solution to it.
Traceback (most recent call last):
  File "./yum", line 22, in ?
    import yummain
ImportError: Bad magic number in /usr/share/yum/yummain.pyc
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
[root@tornado root]# rpm -Uvh yum-1.0.3-0.1.rh7.rf.noarch.rpm 
Preparing...                ########################################### [100%]
package yum-1.0.3-0.1.rh7.rf is already installed
[root@tornado root]# yum check-update
Traceback (most recent call last):
  File "/usr/bin/yum", line 22, in ?
    import yummain
ImportError: Bad magic number in /usr/share/yum/yummain.pyc
[root@tornado root]# cat /etc/redhat-release 
Red Hat Linux release 7.3 (Valhalla)
[root@tornado root]# yum update
Traceback (most recent call last):
  File "/usr/bin/yum", line 22, in ?
    import yummain
ImportError: Bad magic number in /usr/share/yum/yummain.pyc
[root@tornado root]#
Start your free trial to view this solution
Question Stats
Zone: Programming
Question Asked By: LinuxDuke
Solution Provided By: Gns
Participating Experts: 3
Solution Grade: A
Views: 125
Translate:
Loading Advertisement...
02.25.2008 at 09:08AM PST, ID: 20977194

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.26.2008 at 12:41AM PST, ID: 20982532

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.26.2008 at 01:08AM PST, ID: 20982644

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.26.2008 at 03:32AM PST, ID: 20983270

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.27.2008 at 03:52AM PST, ID: 20993163

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.27.2008 at 04:09AM PST, ID: 20993257

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.27.2008 at 04:58AM PST, ID: 20993524

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.27.2008 at 10:01AM PST, ID: 20996510

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.28.2008 at 01:32AM PST, ID: 21002288

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.28.2008 at 02:01AM PST, ID: 21002366

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.28.2008 at 02:08AM PST, ID: 21002397

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.28.2008 at 03:59AM PST, ID: 21002841

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.28.2008 at 04:03AM PST, ID: 21002863

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Microsoft
  • Internet Protocols
  • Applications
  • Development
  • OS
  • Hardware
  • Windows Security
Apple
  • Operating Systems
  • Hardware
  • Programming
  • Networking
  • Software
Internet
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Spy / Ad Blockers
  • Web Browsers
  • New Net Users
  • Web Development
  • Chat / IM
  • Anti Spam
  • Web Servers
  • Anti-Virus
  • Email Clients
Gamers
  • Tips
  • Online / MMORPG
  • Puzzle
  • Emulators
  • Action / Adventure
  • Role Playing
  • Consoles
  • Game Programming
  • Strategy
  • Sports
  • Misc
  • Computer Games
Digital Living
  • Hardware
  • Automotive
  • New Net Users
  • New Users
  • Software
  • Digital Music
  • Gaming World
  • Home Security
  • Apple
  • Networking Hardware
Virus & Spyware
  • Vulnerabilities
  • IDS
  • Encryption
  • Anti-Virus
  • Operating Systems Security
  • Software Firewalls
  • WebApplications
  • Cell Phones
  • Operating Systems
  • Internet
  • Hardware Firewalls
Hardware
  • Displays / Monitors
  • Handhelds / PDAs
  • Components
  • Peripherals
  • Laptops/Notebooks
  • Servers
  • Misc
  • Apple
  • Embedded Hardware
  • Networking Hardware
  • Storage
  • Desktops
  • New Users
Software
  • System Utilities
  • Industry Specific
  • Network Management
  • Photos / Graphics
  • Page Layout
  • VMware
  • Misc
  • Web Development
  • OS
  • CYGWIN
  • Voice Recognition
  • Virtualization
  • Message Queue
  • Quality Assurance
  • Security
  • Firewalls
  • MultiMedia Applications
  • Development
  • Database
  • Office / Productivity
  • Business Management
  • OS/2 Apps
  • Server Software
  • Internet / Email
ITPro
  • OS
  • Storage
  • Encryption
  • Operating Systems Security
  • Apple Hardware
  • Laptops & Notebooks
  • Servers
  • Networking Hardware
  • Peripherals
  • Devices
  • Displays / Monitors
  • WebTrends / Stats
  • Search Engines
  • Firewalls
  • Web Computing
  • WebApplications
  • IDS
  • Vulnerabilities
  • Email Clients
  • File Sharing
  • Spy / Ad Blockers
  • Web Browsers
  • Web Servers
  • Networking
  • Anti-Virus
  • Consulting
  • Chat / IM
  • Anti Spam
Developer
  • Web Servers
  • Web Browsers
  • Game Programming
  • Dev Tools
  • Industry Specific
  • Office / Productivity
  • Database
  • CYGWIN
  • Web Development
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Programming
  • Content Management
  • Application Servers
  • Protocols
Storage
  • Removable Backup Media
  • Storage Technology
  • Servers
  • Grid
  • Remote Access
  • Backup / Restore
  • Misc
  • Hard Drives
OS
  • Miscellaneous
  • Security
  • Development
  • Linux
  • VMware
  • MainFrame OS
  • Unix
  • Apple
  • OS / 2
  • AS / 400
  • BeOS
  • Microsoft
  • VMS / OpenVMS
Database
  • Oracle
  • Miscellaneous
  • MySQL
  • Software
  • Sybase
  • Contact Management
  • PostgreSQL
  • Data Manipulation
  • Clarion
  • InterSystems Cache
  • Siebel
  • MUMPS
  • OLAP
  • SQLBase
  • SAS
  • GIS & GPS
  • 4GL
  • Berkeley DB
  • DB2
  • Informix
  • Interbase / Firebird
  • FoxPro
  • Reporting
  • LDAP
  • Filemaker Pro
  • MS SQL Server
  • dBase
  • MS Access
Security
  • Misc
  • Web Browsers
  • Software Firewalls
  • Operating Systems Security
  • File Sharing
  • Spy / Ad Blockers
  • Vulnerabilities
  • WebApplications
  • IDS
  • Anti-Virus
  • Encryption
  • Anti Spam
  • Email Clients
  • VPN
  • Chat / IM
Programming
  • Editors IDEs
  • Installation
  • Handhelds / PDAs
  • Multimedia Programming
  • System / Kernel
  • Automation
  • Algorithms
  • Game
  • Signal Processing
  • Project Management
  • Open Source
  • Database
  • Misc
  • Languages
  • Processor Platforms
  • Theory
Web Development
  • Scripting
  • Blogs
  • Web Servers
  • Software
  • Search Engines
  • Web Graphics
  • Web Services
  • Images
  • Internet Marketing
  • Images and Photos
  • Components
  • Document Imaging
  • Web Languages/Standards
  • Illustration
  • WebApplications
  • Fonts
  • WebTrends / Stats
  • Authoring
  • Digital Camera Software
  • Miscellaneous
Networking
  • Protocols
  • Apple Networking
  • Network Management
  • Message Queue
  • Application Servers
  • Content Management
  • File Servers
  • Email Servers
  • Misc
  • Java Editors & IDEs
  • Wireless
  • Networking Hardware
  • Backup / Restore
  • System Utilities
  • ISPs & Hosting
  • Web Servers
  • Storage Technology
  • Removable Backup Media
  • Servers
  • Web Computing
  • Broadband
  • Grid
  • OS / 2
  • Novell Netware
  • Unix Networking
  • Windows Networking
  • Security
  • Telecommunications
  • Operating Systems
  • Linux Networking
Other
  • Lounge
  • Business Travel
  • Community Support
  • New Net Users
  • Philosophy / Religion
  • Math / Science
  • Miscellaneous
  • URLs
  • Expert Lounge
  • Politics
  • Puzzles / Riddles
  • Automotive
Community Support
  • Suggestions
  • New to EE
  • New Topics
  • CleanUp
  • Announcements
  • General
  • Feedback
  • Input
  • EE Bugs
 
02.25.2008 at 09:08AM PST, ID: 20977194
 
02.26.2008 at 12:41AM PST, ID: 20982532
Good site but does not resolve the error that I'm getting when executing the yum check-update command or any yum related command.

[root@tornado root]# rpm -Uvh yum-1.0.3-1_73.noarch.rpm
Preparing...                ########################################### [100%]
   1:yum                    ########################################### [100%]
[root@tornado root]# yum check-update
Traceback (most recent call last):
  File "/usr/bin/yum", line 22, in ?
    import yummain
ImportError: Bad magic number in /usr/share/yum/yummain.pyc
[root@tornado root]#
[root@tornado root]#  yum-arch --help
Traceback (most recent call last):
  File "/usr/bin/yum-arch", line 22, in ?
    import pullheaders
ImportError: Bad magic number in /usr/share/yum/pullheaders.pyc
[root@tornado root]#

Yum is intalled thou but why its not executing have not Idea what is this extension for .pyc I think it has something to do with why this is not working. I would like to get this going as soon as possible any help is appreciated.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
[root@tornado root]# rpm -qi yum
Name        : yum                          Relocations: (not relocateable)
Version     : 1.0.3                             Vendor: (none)
Release     : 1_73                          Build Date: Tue 09 Sep 2003 05:15:43 SAST
Install date: Tue 26 Feb 2008 10:27:11 SAST      Build Host: sevenx
Group       : System Environment/Base       Source RPM: yum-1.0.3-1_73.src.rpm
Size        : 225165                           License: GPL
URL         : http://www.dulug.duke.edu/yum/
Summary     : RPM installer/updater
Description :
Yum is a utility that can check for and automatically download and
install updated RPM packages. Dependencies are obtained and downloaded
automatically prompting the user as necessary.
[root@tornado root]# 
Open in New Window
 
02.26.2008 at 01:08AM PST, ID: 20982644
Hi Everyone,

I think the problem is with the Python version I'm using Python 2.2, has anyone have a binary package for the python version im running Python 2.2 .

I will highly appreciate you help

Thanks
 
02.26.2008 at 03:32AM PST, ID: 20983270
Hi Guy's

I'm not trying to be funny or demanding may someone assist me please.
I have searched google and posted this problem on other sites but I'm not getting anything.

Please help me
 
02.27.2008 at 03:52AM PST, ID: 20993163

Rank: Wizard

Question.... Where were you planning on getting updates from? Why would you stick to RH7.3 (which has been dead for several years, baring the now (since 9:th February 2007) discontinued support of the Fedora Legacy project)?
If possible, leave it in the dust of time... Not worth your effort:-).

-- Glenn
 
02.27.2008 at 04:09AM PST, ID: 20993257
Hi Gns,

Unfortunately we are running ibm websphere on this box on Red Hat Linux release 7.3 (Valhalla).
This machine is not going anywhere, anytime soon as our client does not want this box upgraded but is running a lot of application on it.

I have a repository on my network for Redhat 7.3 downloading updates from dagwieers.com, which I setup and its working fine. All i need to do is to install yum on this box then download the updates from the repo below. Does this mean none of the expects have come accross the Python error above and resolved it for yum.

mrepo RPM Mirror on oak (ipaddress)
The subdirectories below are created and managed by mrepo. They contain RPM repositories for use with Smart, up2date, Apt and Yum, directories to allow for remote network installs, as well as ISO files for people to download and burn to disc.
 Name                    Last modified      Size  Description-------------------------------------------------------------------------------- centos4-i386/           20-Nov-2007 10:55    -   CentOS 4 for x86
 centos5-i386/           12-Dec-2007 13:20    -   CentOS 5 for x86
 livna-8-i386/           02-Dec-2007 00:09    -  
 rh73-i386/              22-Feb-2008 14:24    -   Red Hat Linux 7.3 for x86
 rhel4es-i386/           20-Nov-2007 10:58    -   Red Hat Enterprise Server 4 for x86
 rhel5es-i386/           26-Nov-2007 10:34    -   Red Hat Enterprise Server 5 for x86
--------------------------------------------------------------------------------
Powered by mrepo. Written by Dag Wieers.

 
02.27.2008 at 04:58AM PST, ID: 20993524

Rank: Wizard

Ok... One could (as I'm sure you've done already:-) grumble a bit about that ... Updating tfrom prehistory would be .... better.... than trying to keep the beast "afloat"...:-).
Oh well.

I think the lack of input here is because most of us (if not all) have taken the hint (if not before, when fedoralegacy shut down). Dag does an excellent job, but... There has (to my mind) always been a tad too little testing done on at least some of what's there... One need prepare for problems:-).

You could try using the up2date that came with RH7.3 I suppose... I can't guarantee anything though (no testbed with that ol' OS surviving here... Last one went more than a year ago, lagrely unmaintained (had been forgotten in a rack in the DC:-)).

I think you might be correct about python... Did you try doing a manual upgrade to Dags version? Library "hell"? Might not be yum or python itself, but perhaps a "library depended on"... (Slight pause while googling...)
Ah.
This seems to be an issue, exactly as you said, of running a *different* version of python than had initially generated the bytecode file (yummain.pyc)... Solutions would be to get/install a version compatible with your python version, installing (if not already present) the corresponding you source (so that you would have a yummain.py file as well, in the same dir), and possibly forcing a recompile by removing all the related .pyc files... (python would then read/use the .py source and "compile" it into the pyc equivalent).

Cheers
-- Glenn

Cheers
-- Glenn
 
02.27.2008 at 10:01AM PST, ID: 20996510

Rank: Master

If you have the .py file(s) corresponding to the .pyc file(s) try deleting the .pycs and thereby forcing a recompile of the source. That should resolve the version conflict.
 
02.28.2008 at 01:32AM PST, ID: 21002288
Hi Ramrom,

I have deleted the .pycs but how do I force a recompile of the source.

Thanks
 
02.28.2008 at 02:01AM PST, ID: 21002366

Rank: Wizard

Well, provided you do have the corresponding .py files, you just did... all you need do is run yum... and it should work:)

-- Glenn
 
02.28.2008 at 02:08AM PST, ID: 21002397
I have removed the .pycs and did run yum it's not working.

[root@tornado yum]# ls
archwork.py         downloader.py  lilo.py       pullheaders.py   yummain.py
bootloadercfg.py    grubcfg.py     logger.py     serverStuff.py   yum_repo.py
checkbootloader.py  i18n.py        nevral.py     up2datetheft.py  yum_rpm.py
clientStuff.py      iutil.py       pkgaction.py  yum_conf.py
config.py           lilocfg.py     progress.py   yumlock.py
[root@tornado yum]# yum check-update
Traceback (most recent call last):
  File "/usr/bin/yum", line 22, in ?
    import yummain
  File "/usr/lib/yum/yummain.py", line 31, in ?
    import clientStuff
  File "/usr/lib/yum/clientStuff.py", line 27, in ?
    import archwork
  File "/usr/lib/yum/archwork.py", line 25, in ?
    import yum_rpm
  File "/usr/lib/yum/yum_rpm.py", line 18, in ?
    import rpm
ImportError: No module named rpm
[root@tornado yum]#
 
02.28.2008 at 03:59AM PST, ID: 21002841

Rank: Wizard

Hmmm... Where did you get your copy of yum from? http://dag.wieers.com/rpm/packages/yum/ perhaps? Dags rh7 package only contain the pyc files, so you might be better off installing the source rpm and building from that... Or try his package (what you quote above seem not to be from that package... the 1.0.3 for rh7 he provides work from /usr/share, not /usr/lib AFAICS), which should be OK for 7.3.

If all else fails, configure your up2date sources (you can modify the examples Dag has in his FAQ (B4 or B5 IIRC), so that they point to your local mrepo instead... and use that tool.

-- Glenn
 
02.28.2008 at 04:03AM PST, ID: 21002863

Rank: Wizard

Ah, saw the duke link... Ditch that and try Dags package... after all, what do you have to loose:-).
If that borks, I'd first recommend his src package (will install to /usr/src/RPM or similar) and then it'd be a simple matter of "./configure; make; make install" in the source directory... And if that fails too, then go for up2date.
After all, we're in a "whatever works" situation here:-).

-- Glenn
Accepted Solution
 
 
20080236-EE-VQP-29 / EE_QW_2_20070628