How to restore erased rpm data (rpm -e rpm)

How to restore erased rpm data (rpm -e rpm)

Post by Jon Rifki » Sat, 14 Apr 2001 01:10:43



Like an idiot while trying to upgrade rpm I first did

   rpm -e rpm

which of course removed rpm from my system and as far as
I can tell all the data regarding previously installed rpms.

I managed to get an rpm binary running but I don't
have the rpm data (?), so when I try something like this

   rpm -i rpm-3.0.4-0.48.i386.rpm

I get this

        gawk   is needed by rpm-3.0.4-0.48
        fileutils   is needed by rpm-3.0.4-0.48
        textutils   is needed by rpm-3.0.4-0.48
        sh-utils   is needed by rpm-3.0.4-0.48
            ......

I guess I need to rebuild my rpm database.
Any ideas on how to patch this up or am I screwed?

BTW the box runs RedHat 6.0 i386

Thanks in advance.

 
 
 

How to restore erased rpm data (rpm -e rpm)

Post by Jon Rifki » Sat, 14 Apr 2001 02:09:31



> Like an idiot while trying to upgrade rpm I first did

>    rpm -e rpm

> which of course removed rpm from my system and as far as
> I can tell all the data regarding previously installed rpms.

Fix it myself,  thanks.  Here's how

Copied rpm binary from RH6.1 box to RH6.0 box, installed as /bin/rpm.
Had to backup
    /usr/lib/rpm/*
from RH6.1 box to RH6.0 box
I left
    /var/lib/rpm/*
alone (and made a backup in case) as that's where the rpm database
resides.

After that rpm worked - but according to 'rpm -q rpm' it wasn't really
'installed' because it wasn't in the rpm database.

Installed latest rpm for RH6.0 with
   rpm -i rpm-3.0.3......

Everythings back to normal (whew).

 
 
 

How to restore erased rpm data (rpm -e rpm)

Post by aflinsc » Sat, 14 Apr 2001 02:26:13



> Like an idiot while trying to upgrade rpm I first did

>    rpm -e rpm

Ouch

Quote:

> I guess I need to rebuild my rpm database.
> Any ideas on how to patch this up or am I screwed?

Unless you have a backup of your rpm database, you are indeed screwed.

You could also try reinstalling everything..