Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 Mar 2013 08:38:11 +0000
From:      Matthew Seaman <matthew@FreeBSD.org>
To:        freebsd-questions@freebsd.org
Subject:   Re: Ah crap!  pkg_version: the package info for package '...' is corrupt
Message-ID:  <5156A473.4030501@FreeBSD.org>
In-Reply-To: <10944.1364631449@server1.tristatelogic.com>
References:  <10944.1364631449@server1.tristatelogic.com>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
On 30/03/2013 08:17, Ronald F. Guilmette wrote:
> 
> 
> Today my system crashed twice while I was doing "portupgrade -a".
> 
> I'm not sure but I suspect the new cards I have installed recently may
> just be a bit too much for the old power supply I have.  (When the thing
> crashed, the machine just simply shut itself off.  This exact same thing
> has also happened a couple of other times in the past week.)
> 
> I'll deal with the power issue soon, but right now I am more worried about
> this new, different, and additional problem I seem to have created for
> myself.  When I run pkg_version, I am getting a bunch of messages of
> the following general form:
> 
>    pkg_version: the package info for package 'PKG' is corrupt
> 
> where `PKG' is the name of some package or another that I have installed.
> 
> I have at least 6 such messages for different packages I have installed...
> and probably more.

Are you using pkgng?  If so, you'll get the "'PKG' is corrupt" message
for everything when you use pkg_version.  That's because on a pkgng-ized
you should instead be using 'pkg version'.  Same command flags, just
s/_/ /.

> I googled around a bit and did not find any good explanation for the
> above error or, more importantly, what to do about it.
> 
> I gather however that my package data base has become corrupted.
> 
> OK, so how does one rebuild that from scratch?
> 
> Please don't tell me that I have to reinstall every bleedin' port from
> scratch!
> 
> 
> Regards,
> rfg
> 
> 
> P.S.  Oh!  I just remembered.  I made a full system backup quite recently...
> thank god.  Do I just simply need to get the entire contents of /var/db/pkg/
> from that and then do "rm -fr /var/db/pkg" and then copy my backup copy
> of /var/db/pkg to the real /var/db/pkg ?
> 
> Hummm.. that won't reflect the several things that _did_ managed to get
> updated, you know, before my system crashed.

Assuming you *aren't* on a pkgng-ized system:

If you have a recent backup of /var/db/pkg then you should restore from
there.  If you installed or updated any ports between taking the backup
and the crash, then reinstalling those ports will fixup the /var/db/pkg
entries for them.

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.
PGP: http://www.infracaninophile.co.uk/pgpkey



[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.16 (Darwin)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlFWpHMACgkQ8Mjk52CukIwwQACggkpX4HoB/2fzg7pOPMRUW4kv
LhcAmwUz9KIOCYU+mwr9CjTS5QyB3ABH
=q0dg
-----END PGP SIGNATURE-----

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5156A473.4030501>