Portupgrade

Gerard Seibert gerard at seibercom.net
Wed Jul 5 08:39:28 UTC 2006


On Wednesday 05 July 2006 03:21, Psadi wrote:
> HI
>
> This problem is that the /var/db/pkg/pkgdb.db has been damaged. What you
> need to do is to build a new pkgdb.db file
> First cd /var/db/pkg save the old pkgdb by
> mv pkgdb.db -> pkgdb.old
> then you run pkgdb -u
>
> after that you should be up and running again.
>
> Psadi
>
> jan gestre skrev:
> > On 7/3/06, Bill Moran <wmoran at collaborativefusion.com> wrote:
> >> "E. J. Cerejo" <edu07643 at yahoo.com.br> wrote:
> >>
> >>
> >> portupgrade itself I'm getting this message (message bellow) or
> >> similar one
> >> everytime I run one of the portupgrade commands like pkgdb -u or -F,
> >> portversion -L = or portupgrade itself.  Tells me that the database
> >> needs to
> >> be rebuild, I run portsdb -uU and I get this same error message (message
> >> bellow) it rebuilds with portsdb -fuU but still get this same message.
> >>
> >> /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!]
> >>
> >>
> >> When was the last time you did a cvsup?
> >>
> >> Portupgrade was hosed for a few days there, if your ports tree
> >> previously
> >> installed the hosted version, portupgrade won't work.
> >>
> >> If this is the case, the solution is:
> >> 1) cvsup ports
> >> 2) pkg_delete portupgrade
> >> 3) cd /usr/ports/sysutils/portupgrade && make install clean
> >>
> >> Portupgrade will then start working again.
> >>
> >> i always do a cvsup before upgrading the ports but i got the same
> >> problem,
> >
> > pkg_delete did not work coz it can't see the portupgrade version that is
> > installed so i did a make deinstall and make reinstall instead but
> > with the
> > same result, any idea how will i solve this?
From: /usr/ports/UPDATING - THIS MIGHT BE PERTINENT -

20060703:
  AFFECTS: users of sysutils/portupgrade
  AUTHOR: sem at FreeBSD.org

  Because of portupgrade had a bug with detecting of Berkley DB version 2+,
  and a default database now set to use this version you can get portupgrade
  don't work with old databases. A quick fix is removing the databases:
  `rm /var/db/pkg/pkgdb.db /usr/ports/INDEX*.db'. portupgrade will recreate
  them automaticaly. It's absolutely no harm.

  If you don't want remove the databases you should detect what database
  type do you use, and set port options accordly. Follow the instructions:

  - run `pkgdb -fu' *before* upgrading and take a look on the output.
    You can see database format there as: format:XXX, where XXX is your
    current database format.
  - Go to portupgrade port directory and configure the port with
    `make config' command. If you have bdb_* format then turn on BDB4 option,
    if you have bdb1_* format then turn off BDB4 and turn on BDB1 option.
    If you have dbd_hash format then turn off all option.
  - Upgrade portupgrade.

  Note: if you change database format with changing port options,
  you should remove ruby-bdb* port that you don't need anymore or to hard
  code database format in your pkgtools.conf.


-- 
Gerard Seibert
gerard at seibercom.net

COMPASS [for the CDC-6000 series] is the sort of assembler
one expects from a corporation whose president codes in octal.

	J. N. Gray


More information about the freebsd-questions mailing list