Yum update/install to any package is giving me the following error. What actions do I need to take to overcome this?

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 267, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 120, in main
    result, resultmsgs = base.doCommands()
  File "/usr/share/yum-cli/cli.py", line 432, in doCommands
    return self.yum_cli_commands[self.basecmd].doCommand(self,     self.basecmd, self.extcmds)
  File "/usr/share/yum-cli/yumcommands.py", line 226, in doCommand
    return base.updatePkgs(extcmds)
  File "/usr/share/yum-cli/cli.py", line 736, in updatePkgs
    if not self.update(pattern=arg):
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 3687, in update
    obs_tups = self.up.obsoleted_dict.get(installed_pkg.pkgtup, [])
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 878, in     <lambda>
    up = property(fget=lambda self: self._getUpdates(),
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 702, in _getUpdates
    self._up = rpmUtils.updates.Updates(self.rpmdb.simplePkgList(), self.pkgSack.simplePkgList())
  File "/usr/lib/python2.7/site-packages/yum/rpmsack.py", line 489, in simplePkgList
    return self.pkglist
  File "/usr/lib/python2.7/site-packages/yum/rpmsack.py", line 232, in _get_pkglist
    csumpkgtups = self.preloadPackageChecksums(load_packages=False)
  File "/usr/lib/python2.7/site-packages/yum/rpmsack.py", line 966, in     preloadPackageChecksums
    rpmdbv = self.simpleVersion(main_only=True)[0]
  File "/usr/lib/python2.7/site-packages/yum/rpmsack.py", line 1149, in simpleVersion
  File "/usr/lib/python2.7/site-packages/yum/rpmsack.py", line 1098, in _put_cached_simpleVersion_main
    os.rename(rpmdbvfname + ".tmp", rpmdbvfname)
OSError: [Errno 5] Input/output error
  • Rebuild rpm db if yum clean all and disable fastestmirror plugin doesn't work.
    – quanta
    Jul 28 '12 at 16:31
  • @quanta Okay, will do and post back the result here. Jul 28 '12 at 17:38
  • What did you do before this? Did you a minor release update?
    – Nils
    Jul 28 '12 at 19:42
  • Disk full? df -h
    – Tim
    Jul 28 '12 at 22:45

Your situation is imho similar to the one outlined in a CentOS question.

So the solution is possibly the same: Reinstall python, then reinstall yum then do yum clean all && yum makecache and afterwards yum update.

  • A system restart seems to have resolved the problem. Thanks for the answer though. Jul 29 '12 at 22:21
  • @ThinkingMonkey it seems Michael Hampton got it right. After you accepted his answer you can comment on his answer... did you find any bad sectors?
    – Nils
    Jul 30 '12 at 19:00
  • A badblocks /dev/sda did not yield any bad sectors. Sad, could not determine the root of the problem. Jul 30 '12 at 22:03

The important part seems to be the last line:

OSError: [Errno 5] Input/output error

This indicates a physical failure to read or write data from/to the underlying storage medium, i.e. your hard drive.

If you run dmesg you may find at the end some further diagnostic information.

Whenever I run into this particular error I immediately become suspicious of the media. Since it's likely a hard drive, you may want to check its SMART status, for example:

smartctl -a /dev/sda

And check it for bad sectors:

badblocks /dev/sda

Also check to make sure your drive cable is securely connected and that your power supply is supplying enough power.

  • A system restart seems to have resolved the problem. But I am doing a check for bad sectors. Jul 29 '12 at 22:21
  • A badblocks /dev/sda did not yield any bad sectors. Sad, could not determine the root of the problem. Jul 30 '12 at 22:02
  • I had a couple of other ideas you may want to check. Jul 30 '12 at 22:04
  • Sure do post them in the answer.. :) Jul 30 '12 at 22:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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