Pirut is broken

Discussion in 'Linux' started by SDM, Jan 9, 2009.

  1. SDM

    SDM

    Joined:
    Dec 27, 2008
    Messages:
    19
    Likes Received:
    0
    Help. For some reason which I do not know I am no longer able to add remove software. After I have entered the root password I get the following:

    An unhandled exception has occurred. This is most likely a bug. Please save the crash dump and file a detailed bug report against pirut at https://bugzilla.redhat.com/bugzilla

    [user@localhost ~]$ sudo yum install pirut
    rpmdb: Locker is not valid
    rpmdb: Unknown locker ID: 564e
    error: db4 error(22) from db->close: Invalid argument
    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 <module>
    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 154, in getOptionsConfig
    disabled_plugins=opts.disableplugins)
    File "/usr/lib/python2.5/site-packages/yum/__init__.py", line 159, in _getConfig
    self._conf = config.readMainConfig(startupconf)
    File "/usr/lib/python2.5/site-packages/yum/config.py", line 613, in readMainConfig
    yumvars['releasever'] = _getsysver(startupconf.installroot, startupconf.distroverpkg)
    File "/usr/lib/python2.5/site-packages/yum/config.py", line 680, in _getsysver
    idx = ts.dbMatch('provides', distroverpkg)
    TypeError: rpmdb open failed
    [user@localhost ~]$ sudo yum install pirut-release
    rpmdb: Locker is not valid
    rpmdb: Unknown locker ID: 5650
    error: db4 error(22) from db->close: Invalid argument
    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 <module>
    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 154, in getOptionsConfig
    disabled_plugins=opts.disableplugins)
    File "/usr/lib/python2.5/site-packages/yum/__init__.py", line 159, in _getConfig
    self._conf = config.readMainConfig(startupconf)
    File "/usr/lib/python2.5/site-packages/yum/config.py", line 613, in readMainConfig
    yumvars['releasever'] = _getsysver(startupconf.installroot, startupconf.distroverpkg)
    File "/usr/lib/python2.5/site-packages/yum/config.py", line 680, in _getsysver
    idx = ts.dbMatch('provides', distroverpkg)
    TypeError: rpmdb open failed
    [user@localhost ~]$

    If possible I would like to fix this without doing a full system restore.

    Thanks in advance Stewart
     
    SDM, Jan 9, 2009
    #1
  2. SDM

    daldred

    Joined:
    Aug 25, 2008
    Messages:
    887
    Likes Received:
    0
    I've found a refernce to this error here: that discussion of the issue seems to indicate that doing
    Code:
    cd /var/lib/rpm/__db.00x
    sudo rm __db.*
    sudo rpm --rebuilddb 
    may well sort it out.
     
    daldred, Jan 9, 2009
    #2
  3. SDM

    SDM

    Joined:
    Dec 27, 2008
    Messages:
    19
    Likes Received:
    0
    Hi Daldred, thanks for you response. I copy and pasted that info in to the treminal and got the following

    [user@localhost ~]$ cd /var/lib/rpm/__db.00x
    bash: cd: /var/lib/rpm/__db.00x: No such file or directory
    [user@localhost ~]$ sudo rm __db.*
    rm: cannot remove `__db.*': No such file or directory
    [user@localhost ~]$ sudo rpm --rebuilddb
    rpmdb: Locker is not valid
    rpmdb: Unknown locker ID: 565e
    error: db4 error(22) from db->close: Invalid argument
    error: cannot open Packages index using db3 - Invalid argument (22)
    [user@localhost ~]$

    Does this mean any thing to you?

    Stewart
     
    SDM, Jan 10, 2009
    #3
  4. SDM

    daldred

    Joined:
    Aug 25, 2008
    Messages:
    887
    Likes Received:
    0
    It means I got it wrong! Try again:
    Code:
    cd /var/lib/rpm
    sudo rm __db.*
    sudo rpm --rebuilddb 
    (I'd put the filename in the first line where it only wants the directory).
     
    daldred, Jan 10, 2009
    #4
  5. SDM

    SDM

    Joined:
    Dec 27, 2008
    Messages:
    19
    Likes Received:
    0
    Daldred thank you very much, That did the trick.

    Thanks very much Stewart
     
    SDM, Jan 10, 2009
    #5
  6. SDM

    SDM

    Joined:
    Dec 27, 2008
    Messages:
    19
    Likes Received:
    0
    Oh dear spoke to soon. Just tried downloading Amorak and this cropped up

    Component: pirut
    Summary: TBfe59aa7d grabber.py:925:retryfunc:SystemError: unknown opcode

    Traceback (most recent call last):
    File "/usr/sbin/pirut", line 363, in _apply
    output = self.applyChanges(self.mainwin)
    File "/usr/lib/python2.5/site-packages/pirut/__init__.py", line 802, in applyChanges
    dlpkgs = self.downloadPackages(mainwin)
    File "/usr/lib/python2.5/site-packages/pirut/__init__.py", line 500, in downloadPackages
    probs = self.downloadPkgs(dlpkgs)
    File "/usr/lib/python2.5/site-packages/yum/__init__.py", line 891, in downloadPkgs
    cache=po.repo.http_caching != 'none',
    File "/usr/lib/python2.5/site-packages/yum/yumRepo.py", line 640, in getPackage
    cache=cache
    File "/usr/lib/python2.5/site-packages/yum/yumRepo.py", line 618, in _getFile
    http_headers=headers,
    File "/usr/lib/python2.5/site-packages/urlgrabber/mirror.py", line 412, in urlgrab
    return self._mirror_try(func, url, kw)
    File "/usr/lib/python2.5/site-packages/urlgrabber/mirror.py", line 398, in _mirror_try
    return func_ref( *(fullurl,), **kwargs )
    File "/usr/lib/python2.5/site-packages/urlgrabber/grabber.py", line 928, in urlgrab
    return self._retry(opts, retryfunc, url, filename)
    File "/usr/lib/python2.5/site-packages/urlgrabber/grabber.py", line 846, in _retry
    r = apply(func, (opts,) + args, {})
    File "/usr/lib/python2.5/site-packages/urlgrabber/grabber.py", line 925, in retryfunc
    fo.close()
    SystemError: unknown opcode

    Local variables in innermost frame:
    url: http://www.mirrorservice.org/sites/down ... 8.i386.rpm
    self: <urlgrabber.grabber.URLGrabber instance at 0x99761ec>
    filename: //var/cache/yum/fedora/packages/fftw-3.1.2-5.fc8.i386.rpm
    opts: <urlgrabber.grabber.URLGrabberOptions instance at 0x864e50c>
    fo: <urlgrabber.grabber.URLGrabberFileObject instance at 0xce2c66c>
     
    SDM, Jan 10, 2009
    #6
  7. SDM

    daldred

    Joined:
    Aug 25, 2008
    Messages:
    887
    Likes Received:
    0
    I'm guessing here, to be honest, but without digging into the Python code the clue there is that one filename it mentions. On this system, after a pirut run, there should be nothing left in the cache directory, so if there are files left in there it may be causing a problem, though I'm not sure why it should, really.

    Let's try clearing the cache directory it's complaining about: we may also need to clear others later, but if dealing with that one clears up this specific error then it's a start!
    Code:
     cd /var/cache/yum/fedora/packages
    pwd
    (see note below at this point)
    sudo rm -Rf *
    One caution: after the 'pwd' make sure the response is "/var/cache/yum/fedora/packages" before doing the next line. That last line removes all files and directories starting wherever you are, and since you're using sudo it will get everything - start in the wrong place and you could wipe your entire machine!
     
    daldred, Jan 11, 2009
    #7
  8. SDM

    SDM

    Joined:
    Dec 27, 2008
    Messages:
    19
    Likes Received:
    0
    Hi Daldred, once again thanks a lot. I did what you said and I now have Amorak up and running.

    Many thanks Stewart
     
    SDM, Jan 11, 2009
    #8
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.