Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 Mar 2013 08:38:11 +0000
From:      Matthew Seaman <>
Subject:   Re: Ah crap!  pkg_version: the package info for package '...' is corrupt
Message-ID:  <>
In-Reply-To: <>
References:  <>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

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 thin=
> crashed, the machine just simply shut itself off.  This exact same thin=
> 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 ab=
> 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 installe=
> 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 recent=
> thank god.  Do I just simply need to get the entire contents of /var/db=
> 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.



Dr Matthew J Seaman MA, D.Phil.

Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

Version: GnuPG/MacGPG2 v2.0.16 (Darwin)
Comment: Using GnuPG with Thunderbird -



Want to link to this message? Use this URL: <>