1 .\" $NetBSD: pkg_chk.8,v 1.25 2007/08/27 15:28:54 abs Exp $
3 .\" Copyright (c) 2001 by David Brownlee (abs@NetBSD.org)
4 .\" Absolutely no warranty.
10 .Nd check, and optionally update, installed packages
13 .Op Fl aBbcfhiklNnpqrsuv
21 verifies that the versions of installed packages matches those in
22 pkgsrc, optionally adding missing or updating mismatched packages.
24 It can verify all installed packages, or check against a set of packages
25 based on the hostname, architecture, and other characteristics.
27 When updating packages that depend on each other
29 will skip dependent packages to reduce unnecessary rebuilding.
32 .Bl -tag -width xxxxxxxx
34 Automatically add any missing packages.
35 If a binary package exists in
37 it will be used in preference to building from source, unless the
43 Include the "Build version" (see option
46 of packages when determining if a package is up to date.
51 is not set this allows
61 Add the comma separated list of tags to those checked when parsing
66 Fetch all missing/mismatched packages found.
71 to perform the fetch before any building.
75 file based upon the packages installed on the host machine.
79 Continue with further packages if errors are encountered.
81 Redirect the output for all commands run into the logfile
83 Should be specified as a full pathname.
84 On any error the tail end of the logfile will be displayed.
86 List the filename for all binary packages (including best dependencies) based
89 Will abort if a binary package is missing.
90 This can be used (in conjunction with
95 packages would need to be copied to a remote machine to ensure it
96 was completely up to date.
97 The list is sorted so that dependencies
98 always come before packages which depend upon them.
100 For each installed package, look if there is a newer version
102 .Pa ${PKGSRCDIR}/doc/TODO .
103 Good for finding packages to update.
105 Display actions that would be taken, but do not change anything.
107 Set the path to the binary packages.
116 Print list of package directories that will be checked, then exit.
118 Do not display actions or take any action; only list information
119 about package version differences.
120 Useful for options that list information about package differences, such as
125 Recursively delete any mismatched packages found.
126 Use with care, this does not record which packages were installed
129 Building missing packages from source.
130 If UPDATE_TARGET=package is set in
134 will automatically generate binary packages for later reuse.
136 Remove the comma separated list of tags from those checked when
141 Package directories can also be skipped by listing them under
147 will result in all default tags being unset
149 Automatically update any missing packages.
150 If a binary package exists in
152 it will be used in preference to building from source, unless the
158 Note: If the update fails (particularly when building from source), the system
159 will be left with missing packages.
160 Once the error has been fixed, a second run will resume the update.
162 Verbose - list the tags set when checking
164 and all packages checked.
166 .Ss Deprecated Options
167 .Bl -tag -width xxxxxxxx
169 Check versions of packages specified in
171 This is a synomyn for
174 and will be removed in a future version.
176 Check versions of installed packages, ignoring
178 This is a synomyn for
180 and will be removed in a future version.
185 on a line is considered a comment.
189 can either define a new tag or a package directory
190 (such as sysutils/skill), in each case followed by a list of tags.
192 Lines that define a new tag can be used to group tags to avoid
193 repeating the same set of tags for multiple packages.
195 .Dl mailserver \= tll gta tycoon jeeves iris
196 would cause the mailserver tag to be set for any of the listed hosts.
197 Note that the tags after the
199 are parsed with the same set of tag
200 evaluation rules as those after package definitions (see later).
201 .Ss Package definition lines
202 Package directory lines are used to determine which packages are to be
203 installed, checking the tags against the current defined set.
205 Tags on package directory are checked against the current machine's set:
208 If a matched tag starts with a hyphen
210 the package is always excluded.
212 Otherwise if any tags match the package will be included.
214 A line without any tags matches all machines.
220 If a tag starts with an
222 then it is checked for as a readable filename.
224 Tags cannot contain a hyphen
229 Tags separated by spaces are treated as
236 match the current machine.
238 Tags separated by a plus are treated as
245 match the current machine.
248 The default set of tags used to determine which packages to match
251 are equivalent to the output of the following with
252 any spaces converted to hyphens (-): hostname -s, hostname, uname
253 -srm, uname -sr, uname -sm, uname -s, uname -r, uname -m.
255 .Pa /usr/X11R6/lib/libX11.so
257 .Pa /usr/X11R6/lib/libX11.a
260 is added to the list of tags.
261 Tags should not contain the - or + characters.
262 To see tags for the current machine, run
269 uses the following environment variables.
275 .Pa @MAKECONF@ , @PREFIX@/etc/mk.conf ,
280 If not set in the environment, then this variable is read from
282 If it is still not set, and if the current working directory
283 appears to be inside a pkgsrc tree, then this variable
284 is set to the base of that pkgsrc tree.
287 appears to contain a pkgsrc tree, then that is used as a last resort.
289 pkgsrc database directory.
290 If not set in environment then read from
295 Location of binary packages.
296 If not set in environment then read from
299 .Pa ${PKGSRCDIR}/packages .
301 Unless in a completely homogeneous environment (every machine running
302 exactly the same OS version and architecture) setting
308 ${PKGSRCDIR}/packages/${LOWER_OPSYS}-${OS_VERSION}-${MACHINE_ARCH}
311 is strongly recommended.
314 (devel/cpuflags) is being used to optimally target individual CPU types,
317 should be appended to
320 Pathname to pkg_chk configuration file.
321 If not set in environment then read from
324 .Pa ${PKGSRCDIR}/pkgchk.conf .
325 .It Ev PKGCHK_UPDATE_CONF
326 Pathname to temporary list of installed packages used when updating.
327 If not set in environment then read from
330 .Pa ${PKGSRCDIR}/pkgchk_update-$(hostname).conf .
331 Note, if pkgsrc is being
332 shared across multiple machines which may be updating at the same time then
333 it is important this file does not overlap between machines.
335 Additional tags to add when parsing
338 Additional tags to unset when parsing
347 mailserver = tll gta tycoon jeeves iris
349 # Install before others
355 mail/spamassassin mailserver
356 mail/cyrus-imapd mailserver
357 mail/procmail mailserver bobhost
359 shells/standalone-tcsh *
360 wm/pwm /etc/X11/XF86Config
362 print/acroread /etc/X11/XF86Config+i386
363 www/communicator x11+sparc x11+sparc64
364 www/navigator x11+i386
365 x11/xlockmore x11 -wopr
371 plus much from Stoned Elipot.
373 When used against binary packages,
375 does not handle the directory containing multiple versions of the same package.