xref: /openbsd/usr.sbin/pkg_add/pkg_check.8 (revision 4207bc30)
1.\"	$OpenBSD: pkg_check.8,v 1.12 2020/11/16 17:52:08 jmc Exp $
2.\"
3.\" Copyright (c) 2010 Marc Espie <espie@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: November 16 2020 $
18.Dt PKG_CHECK 8
19.Os
20.Sh NAME
21.Nm pkg_check
22.Nd check consistency of installed packages
23.Sh SYNOPSIS
24.Nm pkg_check
25.Bk -words
26.Op Fl FfIimnqvx
27.Op Fl D Ar name Ns Op = Ns Ar value
28.Ek
29.Sh DESCRIPTION
30.Nm
31verifies as much information as it can about installed packages.
32.Pp
33.Nm
34is not needed under normal circumstances, but it can be used to recover after
35a catastrophic system failure in the middle of a
36.Xr pkg_add 1
37or
38.Xr pkg_delete 1 .
39.Pp
40.Nm
41performs the following checks:
42.Bl -tag -width small
43.It Packing-list sanity
44Checks that
45.Pa /var/db/pkg
46only contains directories, that each directory holds a packing-list,
47and that said packing-list is an actual packing-list that matches the directory.
48.It Direct dependencies
49Checks that all direct dependencies are recorded correctly,
50specifically, that
51.Cm @depend ,
52.Cm @tag
53and
54.Cm @wantlib
55match actual packages.
56It currently does not verify that
57.Cm @wantlib
58or
59.Cm @tag
60are reachable from the base package.
61.It Reverse dependencies
62Checks that all direct dependencies have corresponding reverse dependencies.
63.It Files from packages
64Checks that each file, link or directory in those packing-lists actually exist,
65and that their checksum matches what's recorded in the packing-list.
66.It Other files Po option Fl F Pc
67Checks that there are no other random objects under
68.Pa /usr/local .
69.El
70.Pp
71By default,
72.Nm
73will only perform very safe transformations, such as the removal of core-dumps.
74.Nm
75will ask the user for more permanent changes in interactive mode,
76or perform them anyway with option
77.Fl f .
78.Pp
79The options are as follows:
80.Bl -tag -width Ds
81.It Xo
82.Fl D
83.Ar name Ns Op = Ns Ar value
84.Xc
85Extra options.
86Recognized keywords include:
87.Bl -tag -width "nosigXXX"
88.It Cm nosig
89Do not check digital signatures.
90.El
91.It Fl F
92Check the filesystem for random objects.
93.It Fl f
94Force the removal of bogus package information.
95.It Fl I
96Force non-interactive mode.
97Default is to be interactive when run from a tty.
98.It Fl i
99Force interactive mode, even if not run from a tty.
100.It Fl m
101Causes
102.Nm
103to always display the progress meter in cases it would not do so by default.
104.It Fl n
105Don't actually modify packages, just perform checks.
106.It Fl q
107Don't verify checksums for files, just check for their existence.
108Doubling
109.Fl q
110will bypass that check entirely.
111.It Fl v
112Turn on verbose output.
113Several
114.Fl v
115may turn on more verbose output.
116.It Fl x
117Disable progress meter.
118.El
119.Sh SEE ALSO
120.Xr fsck 8
121.Sh AUTHORS
122This program was written by
123.An Marc Espie .
124.Sh BUGS
125Work in progress.
126The order of checks is not definitive, and more checks may be added.
127Use with caution.
128