Portupgrade failed - /var/db/pkg/pkgdb.db: unexpected file type or format

Donald J. O'Neill donaldjoneill at gmail.com
Sun Jul 2 16:18:32 UTC 2006


On Sunday 02 July 2006 08:37, Dominik Zalewski wrote:
> On Sunday 02 July 2006 16:35, Vlad GALU wrote:
> > On 7/2/06, Dominik Zalewski <dzalewski at open-craft.com> wrote:
> > > I'm using FreeBSD 6.1-stable . Today I updated my ports tree using
> > > cvsup and then I ran as usually portupgrade -a . It upgraded my
> > > portupgrade to version portupgrade-2.1.3.2,2. After that portupgrade
> > > stopped working.
> > >
> > > Here is an error message:
> > >
> > > [root at silicon /]# portupgrade -a
> > > [Updating the pkgdb <format:bdb_btree>
> > > in /var/db/pkg ... /var/db/pkg/pkgdb.db: unexpected file type or format
> > > -- Invalid argument; rebuild needed] [Rebuilding the pkgdb
> > > <format:bdb_btree> in /var/db/pkg ... [Updating the pkgdb
> > > <format:bdb_btree>
> > > in /var/db/pkg ... /var/db/pkg/pkgdb.db: unexpected file type or format
> > > -- Invalid argument; rebuild needed] [Rebuilding the pkgdb
> > > <format:bdb_btree> in /var/db/pkg ... /var/db/pkg/pkgdb.db: unexpected
> > > file type or format -- Invalid argument: Cannot update the pkgdb!]:
> > > Cannot update the pkgdb!] Command failed [exit code 1]:
> > > /usr/local/sbin/pkgdb -aFQ
> >
> >    Removing pkgdb.db and INDEX-6.db and then rebuilding them with
> > pkgdb and portsdb did the trick for me.
> >
> > > Any ideas?
> > >
> > > Thank you in advance,
> > >
> > >      Dominik Zalewski
> > > _______________________________________________

>
> Thanks man, alreadt fixed :)
>
> Regards,
>
>       Dominik Zalewski
>

Pretty good answers, but it may involve a little more work than that. This is 
what I did:

mv /usr/ports/INDEX-6.db --> INDEX-6.db.org
mv /var/db/pkg/pkgdb.db --> pkgdb.db.org

pkg_delete portupgrade-2.1.3.1,2
pkg_delete ruby18-bdb-0.5.9
pkg_delete ruby18-bdb1-0.2.2
pkg_delete db4-4.0.14_1,1
pkg_delete db41-4.1.25_3
pkg_delete db42-4.2.52_4

I left db43-4.3.29, It would be needed later and reomoving it would cause too 
many other things to have to be rebuilt (or I get a bite in the ass if I 
don't).

cd /usr/ports/sysutils/portupgrade
make conf  ----- select bdb4, it'll use db43 as that's what's installed
make package-recursive

pkgdb -F	fix the dependencies
portversion -v |grep needs	rebuilds portsdb (and rechecks pkgdb.db) and I find 
out what ports need upgrading.

By the way, I don't use cvsup to upgrade the ports tree. I use portsnap. It's 
way faster than cvsup. When I used cvsup it could take up to 1/2 hr 
(depending on the computer speed) to get to the point of upgrading ports. 
Using portsnap, it only takes a couple of minutes to get to it.

Don


More information about the freebsd-stable mailing list