Synopsis
An executable can arrive in an operating system installation set, an add-on package, or a local installation. Identify which inventory records the exact path. Use an ordinary account in the installation that contains the file. On OmniOS and Oracle Solaris, check the zone with zonename first. The Solaris procedure follows the 11.4 manual.
Start with a path
A shell command name can identify an alias, a shell built-in, or an executable. In a Bourne-style shell, inspect the name before looking for a package.
command -v lsIf the result is an alias or built-in, choose a specific executable for the investigation. Inspect the path with ls -ld. A symbolic link and its target can have different providers. Use the path recorded in the package database and preserve any distinction between the two. Portable Operating System Interface (POSIX) command lookup
OmniOS
On OmniOS r151060, restrict the Image Packaging System (IPS) search to the installed image. Ask for the delivered path and the package name.
pkg search -l -o path,pkg.name /usr/bin/lsMatch the PATH field to usr/bin/ls. The package name on that row identifies the provider recorded in the image. On r151060, the installed package for this path was SUNWcs. A local query in a named zone returned the same provider with a warning about index performance. The matching path and package row still answered the query. Search with the leading slash even though the manifest records paths relative to the root. A remote search can answer which packages offer a file across a publisher’s repository. A remote match alone leaves the local ownership question open. OmniOS pkg(1)
Oracle Solaris
On Solaris 11.4, search for an exact library path in the local image. Include the complete package identifier in the result.
pkg search -l /lib/libinetutil.so.1A result whose ACTION is file and whose VALUE is lib/libinetutil.so.1 names the package that declares that path. Oracle’s example identifies system/library. A search by the short name alone can also return links or files in other directories. If the release label identifies Solaris 10, use its System V Release 4 package lookup. Oracle Solaris file-to-package lookup
OpenBSD
OpenBSD 8.0 distributes the base system in release sets and records add-on packages in a separate database. For an installed copy of curl from packages, inspect the add-on package inventory.
pkg_info -E /usr/local/bin/curlOn an OpenBSD 8.0 installation with curl present, the query returned curl-8.23.0. The suffix identifies the installed package version. If curl is absent, run pkg_info to list installed packages. Choose one, list its files with pkg_info -L followed by the package name, and query one of those paths with pkg_info -E. A base-only machine may have no suitable add-on example. OpenBSD 8.0 pkg_info(1)
Now check a base executable. Read the exit status immediately after the query.
pkg_info -E /bin/ls
printf 'Lookup status: %s\n' "$?"On the same OpenBSD installation, the add-on lookup returned status 1 for /bin/ls and found no package record. To identify its distribution source, obtain the matching OpenBSD 8.0 release’s base80.tgz and SHA256.sig for the machine’s architecture. From the directory containing both, verify the archive with the release key.
signify -C -p /etc/signify/openbsd-80-base.pub -x SHA256.sig base80.tgzAfter verification succeeds, list the archive member without extracting it.
tar -tzf base80.tgz | grep -E '^(\./)?bin/ls$'The matching member establishes that the release set supplies /bin/ls. Local patches and replacements may have changed the installed bytes. OpenBSD installation sets · OpenBSD 8.0 signify(1)
Debian GNU/Linux
On Debian 13, query the local package database for the inventory tool itself.
dpkg-query -S /usr/bin/dpkg-queryRead the package name before the colon and confirm the path after it. For the standard installation, the provider is dpkg. Confirm its current installation status and version.
dpkg-query -W -f='${Status} ${Version}\n' dpkgThe words install ok installed precede the installed version. If a lookup fails for a path traversing a symbolic link such as /bin, inspect the link and try the pathname under which the package lists the file. Debian also documents two gaps in -S: files generated by maintainer scripts and links managed by the alternatives system. Debian 13 dpkg-query(1)
Interpret an empty result
First distinguish a completed search with no matches from a diagnostic about a missing database, insufficient access, or an invalid query. For a completed search, check the exact path, the installation or zone, symbolic links, and the scope of the inventory. On OpenBSD, consult the base sets. On Debian, check generated files and alternatives. For a locally built program under a home directory, the build or installation instructions may be the only installation record. A package match establishes the declared provider of a path. Determining whether the current contents still match the distributed file requires a separate integrity check.