0

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 ?
    yummain.main(sys.argv[1:])
  File "/usr/share/yum-cli/yummain.py", line 85, in main
    base.getOptionsConfig(args)
  File "/usr/share/yum-cli/cli.py", line 163, in getOptionsConfig
    disabled_plugins=self.optparser._splitArg(opts.disableplugins))
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 164, in _getConf
ig
    self._conf = config.readMainConfig(startupconf)
  File "/usr/lib/python2.4/site-packages/yum/config.py", line 685, in readMainCo
nfig
    yumvars['releasever'] = _getsysver(startupconf.installroot, startupconf.dist
roverpkg)
  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?

migrated from stackoverflow.com Oct 29 '15 at 17:42

This question came from our site for professional and enthusiast programmers.

  • @ray: yum clean all is also not working. Throwing same errors. – user1336087 Oct 29 '15 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 '15 at 11:44
  • @ray: Sorry, I really don't remember now. It is an old issue on my test bench. – user1336087 Oct 29 '15 at 12:01
  • Last 10 package installs, with date and time : $ rpm -qa --last | head -10 – Knud Larsen Oct 29 '15 at 14:31
  • What does rpm -V rpm run as root say? – John Oct 29 '15 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.