1 .\" Copyright (c) 2013 Bryan Drewery <bdrewery@FreeBSD.org>
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .Nd a utility for manipulating packages
51 is the package management tool.
52 It is used to manage local packages installed from
54 and install/upgrade packages from remote repositories.
56 To avoid backwards incompatibility issues, the actual
58 tool is not installed in the base system.
59 The first time invoked,
61 will bootstrap the real
63 from a remote repository.
68 is not installed yet, it will be fetched, have its signature verified,
69 installed, and then have the original command forwarded to it.
70 If already installed, the command requested will be forwarded to the real
72 .It Nm Cm add Oo Fl fy Oc Oo Fl r Ar reponame Oc Ar pkg.txz
75 from a local package instead of fetching from remote.
76 If signature checking is enabled, then the correct signature file
77 must exist and the signature valid before the package will be installed.
80 flag is specified, then
82 will be installed regardless if it is already installed.
85 flag is specified, no confirmation will be asked when bootstrapping
90 has been specified, then the signature configuration for that repository will be
93 Do not bootstrap, just determine if
95 is actually installed or not.
96 Returns 0 and the number of packages installed
97 if it is, otherwise 1.
98 .It Nm Oo Fl 46 Oc Cm bootstrap Oo Fl fy Oc \
99 Oo Fl r Ar reponame Oc
100 Attempt to bootstrap and do not forward anything to
102 after it is installed.
108 will force IPv4 or IPv6 respectively to fetch
110 and its signatures as needed.
113 flag is specified, then
115 will be fetched and installed regardless if it is already installed.
118 flag is specified, no confirmation will be asked when bootstrapping
123 has been specified, then the configuration for that repository will be used.
126 The following options are supported by
128 .Bl -tag -width indent
130 Show debug information.
131 May be specified more than once to increase the level of detail.
132 When specified twice,
134 debug output is enabled.
137 Configuration varies in whether it is in a repository configuration file
138 or the global configuration file.
139 The default repository configuration for
142 .Pa /etc/pkg/FreeBSD.conf ,
143 and additional repository configuration files will be searched for in
146 .Pa /usr/local/etc/pkg/repos
151 will process all repositories that it finds and use the last enabled repository
154 Repository configuration is stored in the following format:
155 .Bd -literal -offset indent
157 url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest",
159 signature_type: "none",
160 fingerprints: "/usr/share/keys/pkg",
165 .Bl -tag -width signature_type -compact
187 Defines whether this repository should be used or not.
197 Global configuration can be stored in
198 .Pa /usr/local/etc/pkg.conf
199 in the following format:
200 .Bd -literal -offset indent
201 PACKAGESITE: "pkg+http://pkg.FreeBSD.org/${ABI}/latest",
203 SIGNATURE_TYPE: "none",
204 FINGERPRINTS: "/usr/share/keys/pkg",
205 ASSUME_ALWAYS_YES: "yes"
206 REPOS_DIR: ["/etc/pkg", "/usr/local/etc/pkg/repos"]
213 The following environment variables can be set to override the settings
217 .Bl -tag -width "ASSUME_ALWAYS_YES"
219 This defines which mirror type should be used.
225 This defines the ABI for the package to be installed.
226 Default ABI is determined from
228 .It Ev ASSUME_ALWAYS_YES
229 If set, no confirmation will be asked when bootstrapping
231 .It Ev SIGNATURE_TYPE
234 then a signature will be required and validated against known
235 certificate fingerprints when bootstrapping
242 this value should be set to the directory path where known fingerprints are
248 will be fetched from.
250 Comma-separated list of directories that should be searched for repository
254 Configuration is read from the files in the listed order.
255 This path can be changed by setting
257 The last enabled repository is the one used for bootstrapping
259 .Bl -tag -width "/usr/local/etc/pkg/repos/*.conf"
260 .It Pa /usr/local/etc/pkg.conf
261 .It Pa /etc/pkg/FreeBSD.conf
262 .It Pa /usr/local/etc/pkg/repos/*.conf
265 Some examples are listed here.
266 The full list of available commands are available in
268 once it is bootstrapped.
270 Search for a package:
271 .Dl $ pkg search perl
274 .Dl % pkg install perl
276 List installed packages:
279 Upgrade from remote repository:
282 List non-automatic packages:
283 .Dl $ pkg query -e '%a = 0' %o
285 List automatic packages:
286 .Dl $ pkg query -e '%a = 1' %o
288 Delete an installed package:
289 .Dl % pkg delete perl
291 Remove unneeded dependencies:
294 Change a package from automatic to non-automatic, which will prevent
297 .Dl % pkg set -A 0 perl
299 Change a package from non-automatic to automatic, which will make
301 allow it be removed once nothing depends on it:
302 .Dl % pkg set -A 1 perl
304 Create package file from an installed package:
305 .Dl % pkg create -o /usr/ports/packages/All perl
307 Determine which package installed a file:
308 .Dl $ pkg which /usr/local/bin/perl
310 Audit installed packages for security advisories:
313 Check installed packages for checksum mismatches:
314 .Dl # pkg check -s -a
316 Check for missing dependencies:
317 .Dl # pkg check -d -a
324 command first appeared in
326 It became the default package tool in
329 pkg_install suite of tools