So today I tried to search for a package in yum and I received the following output:

$ sudo yum update yum
Loaded plugins: auto-update-debuginfo, langpacks, presto, refresh-packagekit
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in 
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/", line 321, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/", line 146, in main
    result, resultmsgs = base.doCommands()
  File "/usr/share/yum-cli/", line 485, in doCommands
    return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd, self.extcmds)
  File "/usr/share/yum-cli/", line 405, in doCommand
    return base.updatePkgs(extcmds, update_to=(basecmd == 'update-to'))
  File "/usr/share/yum-cli/", line 890, in updatePkgs
    txmbrs = self.update(pattern=item, update_to=update_to)
  File "/usr/lib/python2.7/site-packages/yum/", line 4440, in update
    m = self.pkgSack.returnNewestByNameArch(patterns=pats)
  File "/usr/lib/python2.7/site-packages/yum/", line 1003, in 
    pkgSack = property(fget=lambda self: self._getSacks(),
  File "/usr/lib/python2.7/site-packages/yum/", line 767, in _getSacks
  File "/usr/lib/python2.7/site-packages/yum/", line 265, in populateSack
  File "/usr/lib/python2.7/site-packages/yum/", line 92, in doSetup'postreposetup')
  File "/usr/lib/python2.7/site-packages/yum/", line 187, in run
    func(conduitcls(self, self.base, conf, **kwargs))
  File "/usr/lib/yum-plugins/", line 79, in postreposetup_hook
    for event, elem in iterparse(infile):
File "", line 84, in next
cElementTree.ParseError: not well-formed (invalid token): line 4097, column 85

There really isn't anything in google about it, so I figured I would just start with a good standard practice. When yum ins't working, and won't do the things you want it to, just clean it first, before trying anything else...

As it turns out, a quick clean fixed the issue:

$ sudo yum clean all