pkg_mklocatedb(1)

pkg_mklocatedb1

Create a locate database for packages

Usage

pkg_mklocatedb [-aKnPqu] [-d repository] [-p portsdir] [pkg-name ...]

Overview

The pkg_mklocatedb command is used to create a file database for binary packages, which can be searched using the locate(1) utility.

Entries created for each package will have the package name prepended: kdelibs-3.3.2p2:/usr/local/bin/meinproc.

If the -p option is used, and SUBDIRLIST is not defined, pkg_mklocatedb will retrieve all package entries from the ports tree.

If the -p option is used together with SUBDIRLIST, pkg_mklocatedb will retrieve the package entries listed in SUBDIRLIST from the ports tree.

Otherwise, pkg_mklocatedb will build database entries for every file object for each pkg-name given on the command line, or for every package in a repository specified as the -d option. If no package name is given, pkg_mklocatedb will build database entries for all currently installed packages.

By default (unless standard output is a terminal), the list of names is fed to /usr/libexec/locate.mklocatedb and the end result should be redirected to a file.

The options are as follows:

-a

Prepend file names with pkgpath information and package names.

-d repository

Scan directory repository for packages.

-K

Include keyword in each object full name. This is more accurate, but defeats locate(1) compression.

However, note that some meta annotations always make it into the database: @*exec*, @define-tag, @newgroup, @newuser, @option no-default-conflict and @tag.

-n

Do not pipe output to /usr/libexec/locate.mklocatedb (default if standard output is a terminal).

-P

Prepend file names with pkgpath information instead of package name.

-p portsdir

Retrieve packing-lists from the ports tree instead of binary packages.

-q

Be quiet: do not report every package processed to standard error.

-u

Update an existing list. The list must come from standard input, and contain pkgpath information for items to be replaced.

Releases

45 releases since OpenBSD 3.7; the text changed 9 times.

  1. 3.7–4.0
  2. 4.1
  3. 4.2–4.3
  4. 4.4–4.7
  5. 4.8–5.0
  6. 5.1
  7. 5.2
  8. 5.3–5.5
  9. 5.6–7.0
  10. 7.1–8.0

-K since OpenBSD 5.3; -P since OpenBSD 4.1; -a since OpenBSD 4.1; -d since OpenBSD 4.4; -p since OpenBSD 4.1; -u since OpenBSD 5.3.

-C until OpenBSD 5.5; -r until OpenBSD 5.5; -s until OpenBSD 5.5; -x until OpenBSD 5.5.

Authors

Marc Espie

From man 8.0-current-20261101 in OpenBSD 8.0-current (2026-11-01). Parsed by carta from the page's mdoc source.