mobile logo

YUM issue: TypeError: Parsing primary.xml error

posted on December 5, 2007 / IN Linux / 1 Comment

When running a ‘yum check-update’, I would receive an error. The error continued even after running ‘yum clean all’.

The error is shown below:

# yum check-update
Setting up repositories
core 100% |=========================| 1.1 kB 00:00
updates 100% |=========================| 1.2 kB 00:00
extras 100% |=========================| 1.1 kB 00:00
Reading repository metadata in from local files
primary.xml.gz 100% |=========================| 1.0 MB 00:00
Traceback (most recent call last):
File "/usr/bin/yum", line 29, in ?

File "/usr/share/yum-cli/", line 94, in main
result, resultmsgs = base.doCommands()
File "/usr/share/yum-cli/", line 381, in doCommands
return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd, self.extcmds)
File "/usr/share/yum-cli/", line 317, in doCommand
ypl = base.returnPkgLists(extcmds)
File "/usr/share/yum-cli/", line 895, in returnPkgLists
ypl = self.doPackageLists(pkgnarrow=pkgnarrow)
File "/usr/lib/python2.4/site-packages/yum/", line 994, in doPackageLists
File "/usr/share/yum-cli/", line 109, in doRepoSetup
File "/usr/lib/python2.4/site-packages/yum/", line 338, in doSackSetup
File "/usr/lib/python2.4/site-packages/yum/", line 200, in populateSack
sack.populate(repo, with, callback, cacheonly)
File "/usr/lib/python2.4/site-packages/yum/", line 91, in populate
dobj = repo.cacheHandler.getPrimary(xml, csum)
File "/usr/lib64/python2.4/site-packages/", line 40, in getPrimary self.repoid))
TypeError: Parsing primary.xml error: Start tag expected, '<' not found

This took me way longer than it should have to figure out, but I determined from running ‘createrpo’, that the error was actually in a shared library.

# createrepo
Traceback (most recent call last):
File "/usr/share/createrepo/", line 27, in ?
import libxml2
File "/usr/lib64/python2.4/site-packages/", line 1, in ?
import libxml2mod
ImportError: /usr/lib64/python2.4/site-packages/ undefined symbol: xmlXPathContextSetCache

# ldd /usr/lib64/python2.4/site-packages/ => /usr/local/lib/ (0x00002b61705e9000) => /lib64/ (0x00002b6170921000) => /lib64/ (0x00002b6170c6f000) => /lib64/ (0x00002b6170e74000)
/lib64/ (0x0000555555554000)

Notice /usr/local/lib in the above section.

So, I then discovered the problem.
# env|grep -i lib

Somewhere along the way, someone set LD_LIBRARY_PATH in .bash_profile.

Once the LD_LIBRARY_PATH environment variable was removed, the issue went away!

By admin

Tagged With

1 Comment

Please use the form to leave a comment

    • john
      Posted on January 21, 200812:03 am Reply

      hey thanks so much!!! I had the same problem when I tried to build xine and change my library path. I couldnt figure out why yum stopped working. I was at the end of the road ..

      thanks again!! John

Page 1 of 1

Leave a comment.