Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

recreate /var/lib/rpm/Packages

1,241 views
Skip to first unread message

Sputnik

unread,
Jun 1, 2004, 1:29:46 AM6/1/04
to
how to recreate /var/lib/rpm/Packages from an already installed system? I
had a problem with my /var partition, and it screwed rpm's DB.

System is Mandrake 10.0

Thanks

Scott Leighton

unread,
Jun 1, 2004, 1:39:22 AM6/1/04
to
Sputnik wrote:


Did you look at rpm --rebuilddb

Scott

--
http://popfile.sourceforge.net POPFile Opensource Mail Classifier

Sputnik

unread,
Jun 1, 2004, 1:42:04 AM6/1/04
to
Scott Leighton wrote:

> Sputnik wrote:
>
>> how to recreate /var/lib/rpm/Packages from an already installed system? I
>> had a problem with my /var partition, and it screwed rpm's DB.
>>
>> System is Mandrake 10.0
>>
>> Thanks
>
>
> Did you look at rpm --rebuilddb
>
> Scott
>

doesn't work:
[root@zeus rpm]# rpm --rebuilddb
rpmdb: /var/lib/rpm/Packages: file size not a multiple of the pagesize
error: cannot open Packages index

I've googled around all day, and the only solutions found seem to be redhat
only. I mean, there are a couple of programs included in redhat, but i
couldnt find them for mdk.

Scott Leighton

unread,
Jun 1, 2004, 1:53:42 AM6/1/04
to
Sputnik wrote:

You might need to rpm --initdb first. Not sure though and I'm certainly
no expert at this.

Good luck.

VesaA.

unread,
Jun 1, 2004, 2:00:02 AM6/1/04
to
> how to recreate /var/lib/rpm/Packages from an already installed system? I
> had a problem with my /var partition, and it screwed rpm's DB.
>
> System is Mandrake 10.0

http://www.rpm.org/hintskinks/repairdb

VA

Sputnik

unread,
Jun 1, 2004, 2:07:10 AM6/1/04
to
>
> You might need to rpm --initdb first. Not sure though and I'm certainly
> no expert at this.
>
> Good luck.
already tried, before updatedb. doesnt work, either.
it works if you mv Packages to Packages-old, and then rpm --initdb, and rpm
--rebuilddb, but in this case, you end up with an empty database, and that
really isnt what I want. What I am looking for is a way of restoring my
database. thanks

Sputnik

unread,
Jun 1, 2004, 2:18:15 AM6/1/04
to
VesaA. wrote:

those programs are not in my mandrake install....

Jacques

unread,
Jun 1, 2004, 2:24:06 AM6/1/04
to

rpm --rebuilddb

Bill Unruh

unread,
Jun 1, 2004, 12:03:03 PM6/1/04
to
Jacques <jacque...@arcanthea.com> writes:

]rpm --rebuilddb

Does anyone know how that works? If the /var/lib stuff is gone, then the
only way would seem to be to go through every file on the disk and check
the stuff in the various packages to see if the file belongs. This seems
both likely to get stuff (eg the wrong package for something for example
built from a tar) that is wrong, or miss stuff (eg that package you
downloaded into /tmp and installed from there then erased). How does it
actually work?

Message has been deleted

Michael Heiming

unread,
Jun 1, 2004, 2:45:11 PM6/1/04
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
NotDashEscaped: You need GnuPG to verify this message

In alt.os.linux Bill Unruh <un...@string.physics.ubc.ca> suggested:
> Jacques <jacque...@arcanthea.com> writes:

> ]rpm --rebuilddb

AFAIK there are a few options left:

The most important which doesn't seem to apply here, just grep
those missing files from the last BACKUP and run --rebuilddb if
needed.

Reinstall the system.

If you know which packages are installed, you might get away with
a fake install of all packages, "rpm -ihv --justdb xxx.rpm
yyy.rpm ..." and hopefully get your rpm db to a usable state.

rpm -qa --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}.rpm\n' \
> installed.rpm_packages-`date -I`.txt

It would be quite helpful to have this small file, if you don't
have any backup at all, you should if your data is worth anything
to you.

A few small hints, about the process which seems to be rather
badly documented, even if perhaps it didn't got my attention,
because of no problem at all in this direction?

http://www.rpm.org/hintskinks/repairdb/

--
Michael Heiming (GPG-Key ID: 0xEDD27B94)
mail: echo zvp...@urvzvat.qr | perl -pe 'y/a-z/n-za-m/'
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQFAvM6yAkPEju3Se5QRArTEAKDWo7G+q1j7PUQNgJ4pB1P3BeSAEQCeLgLu
r8wLwK+Bw3iZ3GKTmV7uNx8=
=Ba34
-----END PGP SIGNATURE-----

0 new messages