1 .\" $NetBSD: pkg_admin.1,v 1.1.1.12 2013/04/20 15:26:52 wiz 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
75 Override the value of the
77 configuration option with the value
80 Perform checks in a quiet manner.
85 to standard output to indicate progress.
86 This option suppresses this progress indicator.
88 Set the shell glob pattern for package suffixes when matching package
93 to be the null suffix.
94 .It Fl s Ar sfx_pattern
95 Set the shell glob pattern for package suffixes when matching package
100 The default pattern is ".t[bg]z".
102 Print version number and exit.
107 The following commands are supported:
108 .Bl -tag -width indent
109 .It Cm add Ar pkg ...
110 For each listed package, write the absolute pathnames of the files listed in
113 file together with the package they belong to into the package database.
114 This should be used only by
116 .It Cm audit Oo Fl es Oc Oo Fl t Ar type Oc Oo Ar pkg Oc ...
117 Check the listed installed packages for vulnerabilities.
118 If no package is given, check all installed packages.
121 is given, override the
122 .Dv CHECK_END_OF_LIFE
124 .Xr pkg_install.conf 5
129 is given, check the signature of the pkg-vulnerabilities file before using it.
131 restricts the reported vulnerabilities to type
133 .It Cm audit-pkg Oo Fl es Oc Oo Fl t Ar type Oc Oo Ar pkg Oc ...
136 but check only the given package names or patterns.
137 .It Cm audit-batch Oo Fl es Oc Oo Fl t Ar type Oc Oo Ar pkg-list Oc ...
140 but read the package names or patterns one per line from the given files.
141 .It Cm audit-history Oo Fl s Oc Oo Fl t Ar type Oc Oo Ar pkgbase Oc ...
142 Print all vulnerabilities for the given base package names.
143 .It Cm check Op Ar pkg ...
144 Use this command to check the files belonging to some or all of the
145 packages installed on the local machine against the checksum
146 which was recorded in the
148 files at package installation time.
149 Symbolic links also have their integrity checked against the recorded
150 value at package installation time.
151 If no additional argument is given, the files of all installed packages
152 are checked, else only the named packages will be checked (wildcards can
158 files will be parsed and the
159 checksum will be checked for every file found.
160 A warning message is printed if the expected checksum differs from the
161 checksum of the file on disk.
162 Symbolic links are also checked, ensuring that the targets on disk are
163 the same as the contents recorded at package installation time.
164 .It Cm check-license Ar condition
167 can be fulfilled with the currently set of accepted licenses.
168 Prints either yes or no to stdout if the condition can be parsed,
169 otherwise it exits with error.
170 .It Cm check-pkg-vulnerabilities Oo Fl s Oc Ar file
171 Check format and hashes in the pkg-vulnerabilities file
175 is given, also check the embedded signature.
176 .It Cm check-signature Ar file ...
179 is a correctly signed package.
180 .It Cm check-single-license Ar license
183 is a valid license name and if it is in the set of acceptable licenses.
184 Prints either yes or no to stdout if the condition can be parsed,
185 otherwise it exits with error.
186 .It Cm config-var Ar variable
187 Print the current value of
189 as used after parsing the configuration file.
190 .It Cm delete Ar pkg ...
191 For each listed package, remove all file entries in the package database that
192 belong to the package.
193 This should be used only by
196 Dump the contents of the package database, similar to
198 Columns are printed for the key field used in the pkgdb - the filename -,
199 and the data field - the package the file belongs to.
200 .It Cm fetch-pkg-vulnerabilities Oo Fl su Oc
201 Fetch a new pkg-vulnerabilities file, check the format and if
203 is given the signature.
204 If all checks are passed, write it to pkgdb.
207 is given, the fetch is conditional and the file transfer is only done if
208 the remote version is newer than the one in pkgdb.
209 .It Cm findbest Ar pattern ...
210 Search the entries of
212 for packages matching
214 Print the URL of the best matching package to stdout for each pattern.
215 If a pattern is not matched, it is skipped and the command will return
217 .It Cm lsall Ar /dir/pkgpattern
218 .It Cm lsbest Ar /dir/pkgpattern
219 List all/best package matching pattern in the given directory
223 flag is given, then that directory path overrides
225 Can be used to work around limitations of /bin/sh and other
226 filename globbing mechanisms.
227 This option implements matching of
228 pkg-wildcards against arbitrary files and directories, useful mainly in
229 the build system itself.
232 for a description of the pattern.
236 yui# cd /usr/pkgsrc/packages/i386ELF/All/
238 unzip-5.40.tgz unzip-5.41.tgz
239 yui# pkg_admin lsall 'unzip*'
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.40'
243 /usr/pkgsrc/packages/i386ELF/All/unzip-5.40.tgz
244 /usr/pkgsrc/packages/i386ELF/All/unzip-5.41.tgz
245 yui# pkg_admin lsall 'unzip\*[Ge]5.41'
246 /usr/pkgsrc/packages/i386ELF/All/unzip-5.41.tgz
247 yui# pkg_admin lsbest 'unzip\*[Ge]5.40'
248 /usr/pkgsrc/packages/i386ELF/All/unzip-5.41.tgz
249 yui# pkg_admin lsall /usr/pkgsrc/packages/i386ELF/All/'{mit,unproven}-pthread*'
250 /usr/pkgsrc/packages/i386ELF/All/mit-pthreads-1.60b6.tgz
251 /usr/pkgsrc/packages/i386ELF/All/unproven-pthreads-0.15.tgz
253 .It Cm pmatch Ar pattern Ar pkg
258 otherwise returns false.
260 Rebuild the package database mapping from scratch, using the
262 files of the installed packages.
263 This option is only intended for recovery after system crashes
264 during package installation and removal.
266 Rebuild the +REQUIRED_BY files from scratch by reresolving all dependencies.
268 This option is intended to be used for fixing inconsistencies between
269 the records of depending and depended-on packages, such as can arise
272 .It Cm set Ar variable=value pkg ...
273 Set variable with information about the installed package.
276 to remove a variable.
278 Packages that are not installed directly by the user but pulled in as
279 dependencies are marked by setting
281 .It Cm gpg-sign-package pkg spkg
282 Sign the binary package
284 using GPG and write the result to
286 .It Cm x509-sign-package pkg spkg key cert
287 Sign the binary package
296 .It Cm unset Ar variable pkg ...
297 Remove an installation variable.
301 .Xr pkg_install.conf 5
302 for options, that can also be specified using the environment.
304 .Bl -tag -width /var/db/pkg/pkgdb.byfile.db -compact
305 .It Pa /var/db/pkg/pkgdb.byfile.db
306 .It Pa /var/db/pkg/\*[Lt]pkg\*[Gt]/+CONTENTS
314 .Xr pkg_install.conf 5 ,
319 command first appeared in
324 command was written by Hubert Feyrer.