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
47 is the package management tool.
48 It is used to manage local packages installed from
50 and install/upgrade packages from remote repositories.
52 To avoid backwards incompatibility issues, the actual
54 tool is not installed in the base system.
55 The first time invoked,
57 will bootstrap the real
59 from a remote repository.
60 .Bl -tag -width "pkg bootstrap"
61 .It Nm Ao Ar command Ac
64 is not installed yet, it will be fetched, have its signature verified,
65 installed, and then have the original command forwarded to it.
66 If already installed, the command requested will be forwarded to the real
68 .It Nm Li add Oo Fl f Oc Ao Pa pkg.txz Ac
71 from a local package instead of fetching from remote.
75 signature checking is enabled, then the signature will be verified
76 before installing the package.
79 flag is specified, then
81 will be installed regardless if it is already installed.
83 Do not bootstrap, just determine if
85 is actually installed or not.
86 Returns 0 and the number of packages installed
87 if it is, otherwise 1.
88 .It Nm Li bootstrap Op Fl f
89 Attempt to bootstrap and do not forward anything to
91 after it is installed.
94 flag is specified, then
96 will be fetched and installed regardless if it is already installed.
99 Configuration varies in whether it is in a repository configuration file
100 or the global configuration file.
102 Repository configuration can be stored in
103 .Pa /etc/pkg/FreeBSD.conf
104 in the following format:
105 .Bd -literal -offset indent
107 url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest",
109 signature_type: "none",
110 fingerprints: "/usr/share/keys/pkg",
114 .Bl -tag -width signature_type -compact
136 Defines whether this repository should be used or not.
146 Global configuration can be stored in
147 .Pa /usr/local/etc/pkg.conf
148 in the following format:
149 .Bd -literal -offset indent
150 PACKAGESITE: "pkg+http://pkg.FreeBSD.org/${ABI}/latest",
152 SIGNATURE_TYPE: "none",
153 FINGERPRINTS: "/usr/share/keys/pkg",
154 ASSUME_ALWAYS_YES: "yes"
155 REPOS_DIR: ["/etc/pkg", "/usr/local/etc/pkg/repos"]
162 The following environment variables can be set to override the settings
166 .Bl -tag -width "ASSUME_ALWAYS_YES"
168 This defines which mirror type should be used.
174 This defines the ABI for the package to be installed.
175 Default ABI is determined from
177 .It Ev ASSUME_ALWAYS_YES
178 If set, no confirmation will be asked when bootstrapping
180 .It Ev SIGNATURE_TYPE
183 then a signature will be required and validated against known
184 certificate fingerprints when bootstrapping
191 this value should be set to the directory path where known fingerprints are
197 will be fetched from.
199 Comma-separated list of directories that should be searched for repository
203 Configuration is read from the files in the listed order.
204 This path can be changed by setting
206 The last enabled repository is the one used for bootstrapping
208 .Bl -tag -width "/usr/local/etc/pkg/repos/*.conf"
209 .It Pa /usr/local/etc/pkg.conf
210 .It Pa /etc/pkg/FreeBSD.conf
211 .It Pa /usr/local/etc/pkg/repos/*.conf
214 Some examples are listed here.
215 The full list of available commands are available in
217 once it is bootstrapped.
219 Search for a package:
220 .Dl $ pkg search perl
223 .Dl % pkg install perl
225 List installed packages:
228 Upgrade from remote repository:
231 List non-automatic packages:
232 .Dl $ pkg query -e '%a = 0' %o
234 List automatic packages:
235 .Dl $ pkg query -e '%a = 1' %o
237 Delete an installed package:
238 .Dl % pkg delete perl
240 Remove unneeded dependencies:
243 Change a package from automatic to non-automatic, which will prevent
246 .Dl % pkg set -A 0 perl
248 Change a package from non-automatic to automatic, which will make
250 allow it be removed once nothing depends on it:
251 .Dl % pkg set -A 1 perl
253 Create package file from an installed package:
254 .Dl % pkg create -o /usr/ports/packages/All perl
256 Determine which package installed a file:
257 .Dl $ pkg which /usr/local/bin/perl
259 Audit installed packages for security advisories:
262 Check installed packages for checksum mismatches:
263 .Dl # pkg check -s -a
265 Check for missing dependencies:
266 .Dl # pkg check -d -a
273 command first appeared in
275 It became the default package tool in
278 pkg_install suite of tools