1 .\" $NetBSD: pkg_admin.1.in,v 1.1 2010/01/21 21:58:06 jmmv Exp $
3 .\" Copyright (c) 1999-2010 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
6 .\" This code is derived from software contributed to The NetBSD Foundation
7 .\" by Hubert Feyrer <hubert@feyrer.de>.
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
17 .\" 3. All advertising materials mentioning features or use of this software
18 .\" must display the following acknowledgement:
19 .\" This product includes software developed by the NetBSD
20 .\" Foundation, Inc. and its contributors.
21 .\" 4. Neither the name of The NetBSD Foundation nor the names of its
22 .\" contributors may be used to endorse or promote products derived
23 .\" from this software without specific prior written permission.
25 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
26 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
27 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
29 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 .\" POSSIBILITY OF SUCH DAMAGE.
42 .Nd perform various administrative tasks to the pkg system
49 .Op Fl s Ar sfx_pattern
50 .Ar command Op args ...
52 This command performs various administrative tasks around the
56 The following command-line options are supported:
57 .Bl -tag -width indent
59 Print only the base names when matching package names for
64 Read the configuration file from
66 instead of the system default.
70 as the path to the directory in which to find matching package names for
77 as the package database directory.
80 section below for details on how the default value is calculated.
82 Perform checks in a quiet manner.
87 to standard output to indicate progress.
88 This option suppresses this progress indicator.
90 Set the shell glob pattern for package suffixes when matching package
95 to be the null suffix.
96 .It Fl s Ar sfx_pattern
97 Set the shell glob pattern for package suffixes when matching package
102 The default pattern is ".t[bg]z".
104 Print version number and exit.
109 The following commands are supported:
110 .Bl -tag -width indent
111 .It Cm add Ar pkg ...
112 For each listed package, write the absolute pathnames of the files listed in
115 file together with the package they belong to into the package database.
116 This should be used only by
118 .It Cm audit Oo Fl es Oc Oo Fl t Ar type Oc Oo Ar pkg Oc ...
119 Check the listed installed packages for vulnerabilities.
120 If no package is given, check all installed packages.
123 is given, also include end-of-life information.
126 is given, check the signature of the pkg-vulnerabilities file before using it.
128 restricts the reported vulnerabilities to type
130 .It Cm audit-pkg Oo Fl es Oc Oo Fl t Ar type Oc Oo Ar pkg Oc ...
133 but check only the given package names or patterns.
134 .It Cm audit-batch Oo Fl es Oc Oo Fl t Ar type Oc Oo Ar pkg-list Oc ...
137 but read the package names or patterns one per line from the given files.
138 .It Cm audit-history Oo Fl s Oc Oo Fl t Ar type Oc Oo Ar pkgbase Oc ...
139 Print all vulnerabilities for the given base package names.
140 .It Cm check Op Ar pkg ...
141 Use this command to check the files belonging to some or all of the
142 packages installed on the local machine against the checksum
143 which was recorded in the
145 files at package installation time.
146 Symbolic links also have their integrity checked against the recorded
147 value at package installation time.
148 If no additional argument is given, the files of all installed packages
149 are checked, else only the named packages will be checked (wildcards can
155 files will be parsed and the
156 checksum will be checked for every file found.
157 A warning message is printed if the expected checksum differs from the
158 checksum of the file on disk.
159 Symbolic links are also checked, ensuring that the targets on disk are
160 the same as the contents recorded at package installation time.
161 .It Cm check-license Ar condition
164 can be fulfilled with the currently set of accepted licenses.
165 Prints either yes or no to stdout if the condition can be parsed,
166 otherwise it exits with error.
167 .It Cm check-pkg-vulnerabilities Oo Fl s Oc Ar file
168 Check format and hashes in the pkg-vulnerabilities file
172 is given, also check the embedded signature.
173 .It Cm check-signature Ar file ...
176 is a correctly signed package.
177 .It Cm check-single-license Ar license
180 is a valid license name and if it is in the set of acceptable licenses.
181 Prints either yes or no to stdout if the condition can be parsed,
182 otherwise it exits with error.
183 .It Cm config-var Ar variable
184 Print the current value of
186 as used after parsing the configuration file.
187 .It Cm delete Ar pkg ...
188 For each listed package, remove all file entries in the package database that
189 belong to the package.
190 This should be used only by
193 Dump the contents of the package database, similar to
195 Columns are printed for the key field used in the pkgdb - the filename -,
196 and the data field - the package the file belongs to.
197 .It Cm fetch-pkg-vulnerabilities Oo Fl su Oc
198 Fetch a new pkg-vulnerabilities file, check the format and if
200 is given the signature.
201 If all checks are passed, write it to pkgdb.
204 is given, the fetch is conditional and the file transfer is only done if
205 the remote version is newer than the one in pkgdb.
206 .It Cm findbest Ar pattern ...
207 Search the entries of
209 for packages matching
211 Print the URL of the best matching package to stdout for each pattern.
212 If a pattern is not matched, it is skipped and the command will return
214 .It Cm lsall Ar /dir/pkgpattern
215 .It Cm lsbest Ar /dir/pkgpattern
216 List all/best package matching pattern in the given directory
220 flag is given, then that directory path overrides
222 Can be used to work around limitations of /bin/sh and other
223 filename globbing mechanisms.
224 This option implements matching of
225 pkg-wildcards against arbitrary files and directories, useful mainly in
226 the build system itself.
229 for a description of the pattern.
233 yui# cd /usr/pkgsrc/packages/i386ELF/All/
235 unzip-5.40.tgz unzip-5.41.tgz
236 yui# pkg_admin lsall 'unzip*'
237 /usr/pkgsrc/packages/i386ELF/All/unzip-5.40.tgz
238 /usr/pkgsrc/packages/i386ELF/All/unzip-5.41.tgz
239 yui# pkg_admin lsall 'unzip\*[Ge]5.40'
240 /usr/pkgsrc/packages/i386ELF/All/unzip-5.40.tgz
241 /usr/pkgsrc/packages/i386ELF/All/unzip-5.41.tgz
242 yui# pkg_admin lsall 'unzip\*[Ge]5.41'
243 /usr/pkgsrc/packages/i386ELF/All/unzip-5.41.tgz
244 yui# pkg_admin lsbest 'unzip\*[Ge]5.40'
245 /usr/pkgsrc/packages/i386ELF/All/unzip-5.41.tgz
246 yui# pkg_admin lsall /usr/pkgsrc/packages/i386ELF/All/'{mit,unproven}-pthread*'
247 /usr/pkgsrc/packages/i386ELF/All/mit-pthreads-1.60b6.tgz
248 /usr/pkgsrc/packages/i386ELF/All/unproven-pthreads-0.15.tgz
250 .It Cm pmatch Ar pattern Ar pkg
255 otherwise returns false.
257 Rebuild the package database mapping from scratch, scanning
262 files, parsing them and writing the resulting absolute pathnames
263 together with the package they belong to into the package database.
265 This option is intended to be used for upgrading from non-pkgdb-pkg_*
266 tools to pkgdb-pkg_* tools, further manipulation of the pkgdb will be
273 Needs to be run as root.
275 Rebuild the +REQUIRED_BY files from scratch by reresolving all dependencies.
277 This option is intended to be used for fixing inconsistencies between
278 the records of depending and depended-on packages, such as can arise
281 .It Cm set Ar variable=value pkg ...
282 Set variable with information about the installed package.
285 to remove a variable.
287 Packages that are not installed directly by the user but pulled in as
288 dependencies are marked by setting
290 .It Cm gpg-sign-package pkg spkg
291 Sign the binary package
293 using GPG and write the result to
295 .It Cm x509-sign-package pkg spkg key cert
296 Sign the binary package
305 .It Cm unset Ar variable pkg ...
306 Remove an installation variable.
309 .Bl -tag -width indent -compact
313 flag isn't given, then the value of the
315 variable overrides the
316 .Xr pkg_install.conf 5
317 variable of the same name.
318 If all of this fails to locate a value, then it typically defaults to
321 .Sh CONFIGURATION VARIABLES
322 The following variables change the behavior of
325 .Xr pkg_install.conf 5 :
326 .Bl -tag -width CERTIFICATE_ANCHOR_PKGS
327 .It Ev CERTIFICATE_ANCHOR_PKGS
328 .It Ev CERTIFICATE_ANCHOR_PKGVULN
329 .It Ev CERTIFICATE_CHAIN
336 .Bl -tag -width @pkgdbdir@/pkgdb.byfile.db -compact
337 .It Pa @pkgdbdir@/pkgdb.byfile.db
338 .It Pa @pkgdbdir@/\*[Lt]pkg\*[Gt]/+CONTENTS
346 .Xr pkg_install.conf 5 ,
351 command first appeared in
356 command was written by Hubert Feyrer.