-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Friday 07 March 2003 11:46 am, Matthew Saltzman wrote:
> Quotes are edited.
>
> On Fri, 7 Mar 2003, Ed Wilts wrote:
> > On Fri, Mar 07, 2003 at 06:36:07AM -0800, Randy Arnold wrote:
> > > Now, for some reason my RPM database is gone.
> > >
> > > Any ideas?
> >
> > If you have backups of /var/lib/rpm, restore them.  If not, you've
> > got 2 basic choices, both ugly:
> > 1.  Find every file on the system and attempt to determine which
> > package they came from.  Then rpm -ivh --justdb <package>.  If you
> > registered and updated via RHN, then go to the web site and extract
> > the package list.  That will save you a *lot* of work.  If you've
> > done an up2date -p since you corrupted your database, you've dug
> > yourself deeper in a hole.
> >
> > 2.  Do a fresh install.
> >
> > If you have an accurate package list from RHN or your backups, use
> > option 1.  If you don't, use option 2.
>
> If you have an accurate package list, then you don't have to go through
> the pain of finding the packages for all files.  Just "rpm -ivh
> --justdb <package> for each of the packages.
>
> One of the weekly cron jobs dumps the results of "rpm -qa" to
> /var/log/rpmpkgs.  That might be a place to start, but you'll need to
> know what you've upgraded since the last dump.

Save a good copy of /var/log/rpmpkgs before it gets overwritten.
Or, save the week old copy /var/log/rpmpkgs.1 before log rotate runs.

If you have a good copy of  /var/log/rpmpkgs, and access to the installed 
packages (on CD, in var/spool/up2date, etc) I have a script that may be 
useful.

$ ./recover_rpm_db.sh

Usage: recover_rpm_db.sh -f [file_name] -p [path[s] to rpm files].
Where 'file_name' is a file containing a list of rpm packages
that should be included in the rpm database, and -p is the
path or paths that contain the rpm packages. 
Multiple paths may be given.

It's here:
 http://www.tuxfan.homeip.net:8080/hacks/recover_rpm_db.sh

It's a little rough around the edges, but will do the job.

- -- 
- -Michael

pgp key:  http://www.tuxfan.homeip.net:8080/gpgkey.txt
Red Hat Linux 7.{2,3}|8.0 in 8M of RAM: http://www.rule-project.org/
- --
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+aRu4n/07WoAb/SsRAtIZAJ9TANH0/tuBnueudfDBaMXi6sZarQCgkSEm
56IkSnd4ElIe/VJxOqslXlI=
=BoKI
-----END PGP SIGNATURE-----



-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to