HOW GEEK!

geek notes for advice seekers

Portupgrade pkgdb.db “unexpected file type or format” error

# 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 -aFOQ

If this error happens to you, just do:

rm /var/db/pkg/pkgdb.db

And run portupgrade again, it will rebuild the database by itself.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.