I'm unable to run yum command on my Linux machine.
I'm getting the following errors:

dispsim:~$ yum
Failed to set locale, defaulting to C
Loading "rhnplugin" plugin
Loading "security" plugin
error: cannot open Packages index using db3 - Invalid argument (22)
error: cannot open Packages database in /var/lib/rpm
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in ?
  File "/usr/share/yum-cli/yummain.py", line 85, in main
  File "/usr/share/yum-cli/cli.py", line 163, in getOptionsConfig
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 164, in _getConf
    self._conf = config.readMainConfig(startupconf)
  File "/usr/lib/python2.4/site-packages/yum/config.py", line 685, in readMainCo
    yumvars['releasever'] = _getsysver(startupconf.installroot, startupconf.dist
  File "/usr/lib/python2.4/site-packages/yum/config.py", line 752, in _getsysver
    idx = ts.dbMatch('provides', distroverpkg)
TypeError: rpmdb open failed

Redhat-release is Red Hat Enterprise Linux Server release 5.2 (Tikanga)

dispsim-1:~$ uname -a
Linux dispsim 2.6.18-92.el5 #1 SMP Tue Apr 29 13:16:12 EDT 2008 i686 i686 i386 GNU/Linux

I also tried the following steps:

1. su
2. rm /var/lib/rpm/__db.00*
3. rpm --rebuilddb

But this didn't resolve the issue. Any suggestions on this please?

  • @ray: yum clean all is also not working. Throwing same errors.
    – ani627
    Oct 29, 2015 at 11:38
  • What was the last successful yum/rpm operation you ran on this system before this error showed up?
    – code_dredd
    Oct 29, 2015 at 11:44
  • @ray: Sorry, I really don't remember now. It is an old issue on my test bench.
    – ani627
    Oct 29, 2015 at 12:01
  • Last 10 package installs, with date and time : $ rpm -qa --last | head -10
    – Knud Larsen
    Oct 29, 2015 at 14:31
  • What does rpm -V rpm run as root say?
    – John
    Oct 29, 2015 at 17:49


Your Answer

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

Browse other questions tagged or ask your own question.