pkg: sqlite error while executing PRAGMA user_version

Matthew Seaman m.seaman at
Sun Aug 3 09:44:10 UTC 2014

On 03/08/2014 10:16, Wolfgang Hukriede wrote:
> I'm getting
> host> pkg info
> pkg: sqlite error while executing PRAGMA user_version; in file pkgdb.c:2284: database is locked
> I already tried to reboot, rm /var/db/pkg/repo* to no effect.
> When run as root "pkg info" shows a few packages, but most not.
> This is fbsd 8.4, pkg version 1.3.3 on a diskless machine (9.1 as nfs
> server).
> Is there any recipe on how to proceed? I'd very much be willing to
> rebuild the sqlite database from zero but don't know how.

Using sqlite on an NFS mounted partition is unfortunately liable to
various locking problems.  pkg(8) should be NFS resistant, but it may
not be resistant enough...

Can you try this:

# pkg shell
SQLite version 3.8.5 2014-06-04 14:06:34
Enter ".help" for usage hints.
sqlite> select * from pkg_lock ;
sqlite> select * from pkg_lock_pid ;
sqlite> .quit

That shows the expected output when there are no active locks in the
system.  If you system already shows that, then unfortunately it's a
fundamental problem with trying to lock the database on NFS, and will
require an updated version of pkg(8) to fix.



Dr Matthew J Seaman MA, D.Phil.

JID: matthew at

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 1036 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the freebsd-questions mailing list