5

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/xmlrpclib.py:612: 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/yummain.py", line 285, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 136, in main
    result, resultmsgs = base.doCommands()
  File "/usr/share/yum-cli/cli.py", line 434, in doCommands
    self._getTs(needTsRemove)
  File "/usr/lib/python2.6/site-packages/yum/depsolve.py", line 99, in _getTs
    self._getTsInfo(remove_only)
  .
  .
  .
  File "/usr/lib/python2.6/site-packages/yum/repoMDObject.py", line 124, in __init__
    self.parse(srcfile)
  File "/usr/lib/python2.6/site-packages/yum/repoMDObject.py", line 140, in parse
    parser = iterparse(infile)
  File "/usr/lib/python2.6/site-packages/yum/misc.py", line 1169, in cElementTree_iterparse
    _cElementTree_import()
  File "/usr/lib/python2.6/site-packages/yum/misc.py", 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?

ewwhite
  • 197,159
  • 92
  • 443
  • 809

6 Answers6

10

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.

ewwhite
  • 197,159
  • 92
  • 443
  • 809
1

Hmm, in python 2.6, cElementTree lives in /usr/lib64/python2.6/xml/etree/cElementTree.py, 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?

Dennis Kaarsemaker
  • 19,277
  • 2
  • 44
  • 70
1

I have also seen someone causing this issue by putting Oracle's lib/ path in /etc/ld.so.conf.d

Using:

echo /opt/oracle/app/product/11.2.0/dbhome_1/lib/ > /etc/ld.so.conf.d/oracle.conf

Solved this issue by removing /etc/ld.so.conf.d/oracle.conf.

HopelessN00b
  • 53,795
  • 33
  • 135
  • 209
0

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.

Michael Hampton
  • 244,070
  • 43
  • 506
  • 972
0

declare -x didnt work.
This worked for me.

[root@host ~]# unset LD_LIBRARY_PATH

If any variable is defined in /etc/ld.so.conf 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/libexpat.so.1 library.

[root@host ~]# ldd /usr/lib64/python2.6/lib-dynload/pyexpat.so
Vishnu Kumar
  • 131
  • 5
-1

unset LD_LIBRARY_PATH, ldconfig, ldd /usr/lib64/python2.6/lib-dynload/pyexpat.so

As mentioned in https://serverfault.com/a/686667/431469, this worked for me.

Kruthika C S
  • 216
  • 3
  • 7
  • Welcome on the ServerFault! Maybe you could elaborate this more, it is now like a magician answer ("and sacrifice a black hen and you will have rain"). Why? How? – peterh Aug 17 '17 at 21:34