.Dd September 27, 2026 .Dt INFOPKG 8 .Os .Sh NAME .Nm infopkg .Nd query the package database .Sh SYNOPSIS .Nm .Op Fl r Ar root .Fl i .Nm .Op Fl r Ar root .Fl l Ar package | file .Nm .Op Fl r Ar root .Fl o Ar regex .Nm .Fl f Ar file .Nm .Fl h | v .Sh DESCRIPTION .Nm reads the package database, or a package archive, and prints what it finds. Exactly one of .Fl f , .Fl i , .Fl l and .Fl o must be given. .Pp The options are as follows: .Bl -tag -width Ds .It Fl f Ar file Print the footprint of the package archive .Ar file . The database is not used. .It Fl h Print a usage summary. .It Fl i List the installed packages with their versions, sorted by name. .It Fl l Ar package | file List the files of the installed package .Ar package . If no such package is installed, list the files in the package archive .Ar file . .It Fl o Ar regex List the installed files matching the extended regular expression .Ar regex , with the package that owns each. Paths are matched with a leading .Ql / . If nothing matches, .Dq no owner found is printed. .It Fl r Ar root Use the database under .Ar root instead of .Pa / . .It Fl v Print the version. .El .Sh ENVIRONMENT .Bl -tag -width PKG_DBDIR .It Ev PKG_ROOT Root if .Fl r is not given. .It Ev PKG_DBDIR Package database directory; see .Xr addpkg 8 . .El .Sh FILES .Bl -tag -width Ds -compact .It Pa /var/lib/pkg/db Package database. .El .Sh EXIT STATUS .Ex -std Finding no owner with .Fl o is not an error. .Sh EXAMPLES Which package owns .Pa /bin/ls ? .Pp .Dl $ infopkg -o '^/bin/ls$' .Pp List the files in a package archive: .Pp .Dl $ infopkg -l 'nftables#1.1.5-1.pkg.tar.gz' .Sh SEE ALSO .Xr addpkg 8 , .Xr delpkg 8 , .Xr pkg 8