Find the answer to your Linux question:
Results 1 to 9 of 9
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2010
    Posts
    14

    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 ?
    import yum
    File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 50, in ?
    import comps
    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
    python-iniparse-0.2.3-4.el5
    gnome-python2-gnomeprint-2.16.0-3.el5
    gnome-python2-gconf-2.16.0-1.fc6
    python-virtinst-0.400.3-9.el5_5.1
    python-numeric-23.7-2.2.2
    gnome-python2-applet-2.16.0-3.el5
    python-2.4.3-27.el5_5.3
    notify-python-0.1.0-3.fc6
    audit-libs-python-1.7.17-3.el5
    gnome-python2-2.16.0-1.fc6
    gnome-python2-extras-2.14.2-7.el5
    libvirt-python-0.6.3-33.el5_5.3
    gtk-vnc-python-0.3.8-3.el5
    dbus-python-0.70-9.el5_4
    gnome-python2-canvas-2.16.0-1.fc6
    gnome-python2-bonobo-2.16.0-1.fc6
    gnome-python2-gnomekeyring-2.16.0-3.el5
    python-urlgrabber-3.1.0-6.el5
    gnome-python2-gnomevfs-2.16.0-1.fc6
    gnome-python2-desktop-2.16.0-3.el5
    gamin-python-0.1.7-8.el5
    gnome-python2-gtksourceview-2.16.0-3.el5
    rpm-python-4.4.2.3-22.el5
    python-sqlite-1.1.7-1.2.1
    gnome-python2-libegg-2.14.2-7.el5
    libxslt-python-1.1.17-2.el5_2.2
    mod_python-3.2.8-3.1
    libxml2-python-2.6.26-2.1.2.8.el5_5.1
    python-elementtree-1.2.6-5
    python-ldap-2.2.0-2.1
    libselinux-python-1.33.4-5.5.el5


    Not sure where to check if the list is complete though. Any help would be appreciated.

    Thanks

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,691
    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...
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    Aug 2010
    Posts
    14
    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?

    Thanks.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,691
    Quote Originally Posted by Cendent View Post
    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!
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  6. #5
    Just Joined!
    Join Date
    Aug 2010
    Posts
    14
    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?

  7. #6
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,691
    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.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  8. #7
    Just Joined!
    Join Date
    Mar 2012
    Posts
    7
    Quote Originally Posted by Cendent View Post
    [root@localhost ~]# yum update
    Traceback (most recent call last):
    File "/usr/bin/yum", line 4, in ?
    import yum
    File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 50, in ?
    import comps
    File "/usr/lib/python2.4/site-packages/yum/comps.py", line 23, in ?
    iterparse = cElementTree.iterparse
    AttributeError: 'module' object has no attribute 'iterparse'
    My error is 100% identic.

    Please:

    How I can repair?

    I have CentOs 5.7

  9. #8
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,691
    Please post complete question/issue in a new thread. This is an old one and you should not "hijack" it!
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  10. #9
    Administrator jayd512's Avatar
    Join Date
    Feb 2008
    Location
    Kentucky
    Posts
    5,023
    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.
    Jay

    New users, read this first.
    New Member FAQ
    Registered Linux User #463940
    I do not respond to private messages asking for Linux help. Please keep it on the public boards.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •