Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm making a set of changes to a group of 150 servers. All systems were able to successfully download and install a specific set of RPM's via yum, except for one. One this particular system, all yum commands outside of "clean" dump the following to the screen:

[root@dev1v ~]# yum install sssd
Loaded plugins: rhnplugin
/usr/lib64/python2.6/ DeprecationWarning: The xmllib module is obsolete.  Use xml.sax instead.
  import xmllib # lazy subclassing (!)
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in <module>
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/", line 285, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/", line 136, in main
    result, resultmsgs = base.doCommands()
  File "/usr/share/yum-cli/", line 434, in doCommands
  File "/usr/lib/python2.6/site-packages/yum/", line 99, in _getTs
  File "/usr/lib/python2.6/site-packages/yum/", line 124, in __init__
  File "/usr/lib/python2.6/site-packages/yum/", line 140, in parse
    parser = iterparse(infile)
  File "/usr/lib/python2.6/site-packages/yum/", line 1169, in cElementTree_iterparse
  File "/usr/lib/python2.6/site-packages/yum/", line 1164, in _cElementTree_import
    import cElementTree
ImportError: No module named cElementTree

I've tried:

  • yum clean
  • reinstalling bits and pieces manually via RPM... expat, part of python, etc.
  • rebuilding the RPM database

Any thoughts?

share|improve this question
up vote 7 down vote accepted

The fix:

Apparently, the Oracle installation on this system injected Oracle's path into LD_LIBRARY_PATH...

[root@dev1v etc]# export 
declare -x LD_LIBRARY_PATH="/home/oracle/app/oracle/product/11.2.0/client_1/lib"

Unsetting the variable allowed yum to function properly again.

share|improve this answer

Hmm, in python 2.6, cElementTree lives in /usr/lib64/python2.6/xml/etree/, which is part of the python package. The fact that you're reaching the import cElementTree in the yum code indicates that xml.etree seems missing.

Try reinstalling python by manually downloading the rpm and using rpm -Uvh.

If that doesn't work, what happens if you import xml.etree.cElementTree in a python shell? What does rpm --verify python say?

share|improve this answer

I have also seen someone causing this issue by putting Oracle's lib/ path in /etc/


echo /opt/oracle/app/product/11.2.0/dbhome_1/lib/ > /etc/

Solved this issue by removing /etc/

share|improve this answer

Recently, I resolved this problem as the following: (OS: CentOS 6.3 with Oracle installed).

  1. Edit /etc/profile and find export LD_LIBRARY_PATH line if present.

  2. Add /lib64 before $ORACLE_HOME/lib

    export  LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/lib64:$ORACLE_HOME/lib:/lib:/usr/lib:/usr/lib/oracle/11.2/client/lib
  3. Log out and re-logon as root.

share|improve this answer

declare -x didnt work.
This worked for me.

[root@host ~]# unset LD_LIBRARY_PATH

If any variable is defined in /etc/ then remove it and run # ldconfig command to recreate ld cache.

[root@host ~]# ldconfig

Confirm that the Python library now links to the correct /lib64/ library.

[root@host ~]# ldd /usr/lib64/python2.6/lib-dynload/
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.