Yum not working
I was updating Centos from 5.5 to 5.6 when server froze after I restarted and I try to use any yum command for example yum update, yum clean all I will get this:
[root@localhost ~]# yum update
Traceback (most recent call last):
File "/usr/bin/yum", line 4, in ?
File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 50, in ?
File "/usr/lib/python2.4/site-packages/yum/comps.py", line 23, in ?
iterparse = cElementTree.iterparse
AttributeError: 'module' object has no attribute 'iterparse'
I thought it might be a python issue when I run rpm -qa | grep -i python it gives me the following:
[root@localhost ~]# rpm -qa | grep -i python
Not sure where to check if the list is complete though. Any help would be appreciated.
It sounds like when the system froze it broke python, which is how yum is built. Other stuff is likely broken as well. Other than restoring the system drive from backup, I'm not sure what the best approach would be here. You can boot from a live CD/DVD/recovery disc, check your file systems on the server (unmounted), and then copy stuff you are missing back from the boot CD/DVD after you have manually mounted the system partitions. Anyway, thanks for the reminder - I haven't made a bit-image backup of my system drive for too long... :-)
Thanks for the response Rubberman,
Yea I think this will be a lesson learned for me. I did backup some folders on the system nightly, but never made a bit-image back up.
This might be a stupid questions but would it be possible to delete the /usr/bin/python folder and just move the backuped /user/bin/python in it's place?
The only stupid questions are the unasked ones... :-) Anyway, it may be possible. My suggestion is to rename it in place, and copy the backup one to the original place. That way you can determine what, if any, changes there are. One thing I do wish Linux distributions had is a good "repair without reinstalling" facility that would fixup all this cruft, at least as far as the standard install features are concerned, such as the package managers, etc. Most of the time "repair" just drops you into a single-user root login, and leaves all the gnarly details to the user to deal with. In any case, if some lurker out there knows of such a tool, I'd love to hear about it!
Originally Posted by Cendent
Thanks for the replies :). Think I may have gotten lucky, moving it over seemed to fix it.
Hooking up external hard driver to do a bit-image backup tonight before I go to bed. So with a bit-image backup if something like this where to happen again and I just wanted to start from where the backup was, what would be the easiest way to do that?
1. Do the bit-image backup.
2. Use rsync to backup changed files to an external drive.
When you need to restore, you
1. Restore the bit image.
2. Restore the changed files.
If you repartition your system drive, you will need to redo the bit-image backup. Also, it is not a bad idea to do one on a regular basis, depending upon need - once a month is probably reasonable, but more frequently may not be a bad idea. Also, you can inline compress the backup to reduce the space needed. My 320GB system drive typically gets compressed to around 50GB. So, doing that, you can keep 2 or 3 historical images on the same media. Myself, I use a 2TB external 7200rpm sata drive (costs about $100USD per disc) for capacity and performance, and have several as a father-grandfather-son configuration. That gives me plenty of storage and redundancy for a reasonable cost. Beats tape as far as I'm concerned. A tape drive system with a 2TB capacity would cost several thousand dollars (not including media). 3x2TB discs with an eSata 2 or 3 dock is well under $500USD.
My error is 100% identic.
Originally Posted by Cendent
How I can repair?
I have CentOs 5.7
Please post complete question/issue in a new thread. This is an old one and you should not "hijack" it! :-(
Hi, PgSQL. Welcome to LinuxForums!
As said by Rubberman, this thread is almost a year old. So it would be better if you started a new thread, giving as much information as you can.
Locking this one down.