pkg: sqlite error while executing sqlite open in file pkgdb.c:1126: unable to open database file

Mel Pilgrim list_freebsd at bluerosetech.com
Thu Oct 12 20:43:08 UTC 2017


On 10/11/2017 11:15, Jos Chrispijn wrote:
> Dear group,
> 
> Apparently I have an issue when finalizing the ports with portmanager.
[...]
> pkg: sqlite error while executing sqlite open in file pkgdb.c:1126: 
> unable to open database file
> 
> I checked numerous solutions, but most of them refer to a solution done 
> with the pkg command, while I am using portmaster to upgrade.
> 
> Can someone tell me how I can solve this issue without risking my ports 
> collection being corrupted by some pkg command?

This is a known bug in pkg caused by pkg running with a CWD that either 
doesn't exist or it doesn't have permissions.

See https://github.com/freebsd/pkg/issues/1552

The workaround is making sure the directory you're in when you run pkg 
commands exists and has at least mode 0555.


More information about the freebsd-ports mailing list