Category: FreeBSD

  • Bind on FreeBSD 7.2 error: named[1531]: the working directory is not writable

    To fix this error, edit the following file:

    /etc/mtree/BIND.chroot.dist

    Change:

    /set type=dir uname=root gname=wheel mode=0755

    into:

    /set type=dir uname=bind gname=wheel mode=0755

    Then restart bind:

    /etc/rc.d/named restart

  • 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.