How to: Fix stuck package manager (Yum/add-remove programs)

Discussion in 'Linux' started by rebuilder, Aug 24, 2008.

  1. rebuilder

    rebuilder

    Joined:
    Aug 20, 2008
    Messages:
    55
    Likes Received:
    0
    Maybe I'm the first to get this problem, but probably I won't be the last. I managed to get my RPM database into such a state that package managers wouldn't work - they'd just get stuck. Probably I killed a package manager process that seemed to be stuck but wasn't, and it left the database in a bad state. Google helped, though, here's what needs doing:

    Code:
    su - 
    rm -f /var/lib/rpm/__db* 
    rpm -vv --rebuilddb
    yum clean all
    [code]
    
    This gets rid of the corrupted database files and rebuilds the rpm database. If yum complains about another process having lock on yum.pid, do an rm /var/run/yum.pid if you're sure you don't have another package manager running.
    
    Edited for typo, thanks for pointing it out, tafelpoot
     
    rebuilder, Aug 24, 2008
    #1
  2. rebuilder

    tafelpoot

    Joined:
    Aug 24, 2008
    Messages:
    5
    Likes Received:
    0
    Many and Thanx for posting this!!!

    I made a small correction,
    I had to type rpm --rebuilddb (no - between rebuild and db)

    so the code is:
    Code:
    su -
    rm -f /var/lib/rpm/__db*
    rpm -vv --rebuilddb
    yum clean all
    
    thanx again for the helpfull tip!
     
    tafelpoot, Aug 24, 2008
    #2
  3. rebuilder

    malstead

    Joined:
    Jan 18, 2009
    Messages:
    5
    Likes Received:
    0
    Hi

    Just wanted to say a massive THANX for this.... having never had a working pirut from my refurbed aa1 from day1 i had spent many hours of searching this forum and others to no avail, i was just about ready to go thru the palava of reinstalling linpus by usb drive, just to get package manager working again! (not to mention then having to remove the linpus desktop all over again!!).
     
    malstead, Jan 30, 2009
    #3
  4. rebuilder

    mcornish

    Joined:
    Feb 2, 2009
    Messages:
    1
    Likes Received:
    0
    Hi I'm new user of Linux and have same problem with pirut and pup, both applications start but then hang. They cannot be closed with usual methods and both have everything greyed out. I have tried the above fix
    su -
    rm -f /var/lib/rpm/__db*
    rpm -vv --rebuilddb
    yum clean all

    But stll have same problem. Anyone have any ideas on next step

    Many thanks
     
    mcornish, Feb 17, 2009
    #4
  5. rebuilder

    Guest Guest

    Im having the same problem as mcornish, Ive ran the script but I can't open package manager
     
    Guest, Feb 20, 2009
    #5
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.