---
name: "pkg_check"
section: "8"
platform: "openbsd"
package: "man"
version: "8.0-current-20261101"
release: "OpenBSD 8.0-current (2026-11-01)"
platforms: ["openbsd"]
url: "https://new.carta.tech/pkg_check"
---

# pkg\_check(8)

check consistency of installed packages

## NAME

**pkg\_check** – check consistency of installed packages

## SYNOPSIS

**pkg\_check** \[**-FfIimnqvx**\] \[**-D** *name*\[=*value*\]\]

## DESCRIPTION

**pkg\_check** verifies as much information as it can about installed packages.

**pkg\_check** is not needed under normal circumstances, but it can be used to recover after a catastrophic system failure in the middle of a pkg\_add(1) or [pkg\_delete(1)](/pkg_delete/1.md).

**pkg\_check** performs the following checks:

- Packing-list sanity

  Checks that */var/db/pkg* only contains directories, that each directory holds a packing-list, and that said packing-list is an actual packing-list that matches the directory.

- Direct dependencies

  Checks that all direct dependencies are recorded correctly, specifically, that **@depend**, **@tag** and **@wantlib** match actual packages. It currently does not verify that **@wantlib** or **@tag** are reachable from the base package.

- Reverse dependencies

  Checks that all direct dependencies have corresponding reverse dependencies.

- Files from packages

  Checks that each file, link or directory in those packing-lists actually exist, and that their checksum matches what's recorded in the packing-list.

- Other files (option **-F**)

  Checks that there are no other random objects under */usr/local*.

By default, **pkg\_check** will only perform very safe transformations, such as the removal of core-dumps. **pkg\_check** will ask the user for more permanent changes in interactive mode, or perform them anyway with option **-f**.

The options are as follows:

-

  **-D** *name*\[=*value*\] Extra options. Recognized keywords include:

  - **nosig**

    Do not check digital signatures.

- **-F**

  Check the filesystem for random objects.

- **-f**

  Force the removal of bogus package information.

- **-I**

  Force non-interactive mode. Default is to be interactive when run from a tty.

- **-i**

  Force interactive mode, even if not run from a tty.

- **-m**

  Causes **pkg\_check** to always display the progress meter in cases it would not do so by default.

- **-n**

  Don't actually modify packages, just perform checks.

- **-q**

  Don't verify checksums for files, just check for their existence. Doubling **-q** will bypass that check entirely.

- **-v**

  Turn on verbose output. Several **-v** may turn on more verbose output.

- **-x**

  Disable progress meter.

## SEE ALSO

[fsck(8)](/fsck/8.md)

## AUTHORS

This program was written by Marc Espie.

## BUGS

Work in progress. The order of checks is not definitive, and more checks may be added. Use with caution.
