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.
Finally opened! Best Linux graphical editor for large files