2 .\" FreeBSD install - a package for the installation and maintainance
3 .\" of non-core utilities.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
25 .Nd a utility for installing software package distributions
31 .Ar pkg-name [pkg-name ...]
35 command is used to extract packages that have been previously created
43 command may execute scripts or programs contained within a package file,
44 your system may be susceptible to
47 attacks from miscreants who create dangerous package files.
49 You are advised to verify the competence and identity of those who
50 provide installable package files. For extra protection, use the
52 flag to extract the package file, and inspect its contents and scripts to
53 insure it poses no danger to your system's integrity. Pay particular
54 attention to any +INSTALL, +POST-INSTALL, +DEINSTALL, +POST-DEINSTALL,
55 +REQUIRE or +MTREE_DIRS files, and inspect the +CONTENTS file for
63 directives, and/or use the
65 command to examine the package file.
69 The following command line arguments are supported:
70 .Bl -tag -width indent
71 .It Ar pkg-name [... pkg-name]
72 The named packages are installed. A package name of - will cause
74 to read from stdin. If the packages are not found in the current
77 will search them in each directory named by
80 Turn on verbose output.
82 If a installation scripts (pre-install or post-install) exist for a given
83 package, do not execute them.
85 Don't actually install a package, just report the steps that
86 would be taken if it was.
88 Do not record the installation of a package. This means
89 that you cannot deinstall it later, so only use this option if
90 you know what you are doing!
92 Use the remote fetching feature. This will determine the appropriate
93 objformat and release and then fetch and install the package.
95 Force installation to proceed even if prerequisite packages are not
96 installed or the requirements script fails. Although
98 will still try to find and auto-install missing prerequisite packages,
99 a failure to find one will not be fatal.
103 as the directory in which to extract files from a package.
104 If a package has set its default directory, it will be overridden
105 by this flag. Note that only the first
107 directive will be replaced, since
109 has no way of knowing which directory settings are relative and
110 which are absolute. It is rare in any case to see more than one
111 directory transition made, but when such does happen and you wish
112 to have control over *all* directory transitions, then you
113 may then wish to look into the use of
129 By default, this is the string
130 .Pa /var/tmp/instmp.XXXXXX ,
131 but it may be necessary to override it in the situation where
134 directory is limited. Be sure to leave some number of `X' characters
137 to fill in with a unique ID.
139 You can get a performance boost by setting the staging area
141 to reside on the same disk partition as target directories for package
142 file installation; often this is
147 mode. This is a very specialized mode for running
149 and is meant to be run in conjunction with
151 mode. When run in this mode,
153 does no work beyond extracting the package into a temporary staging
156 option), reading in the packing list, and then dumping it (prefaced by
157 the current staging area) to stdout where it may be filtered by a
160 When used in conjunction with
162 mode, it allows you to make radical changes to the package structure
163 before acting on its contents.
167 mode. This is a very specialized mode for running
169 and is meant to be run in conjunction with
171 mode. When run in this mode,
173 expects the release contents to be already extracted and waiting
174 in the staging area, the location of which is read as a string
175 from stdin. The complete packing list is also read from stdin,
176 and the contents then acted on as normal.
181 arguments may be specified, each being either a file containing the
182 package (these usually ending with the
185 URL pointing at a file available on an ftp site. Thus you may
186 extract files directly from their anonymous ftp locations (e.g.
188 ftp://ftp.freebsd.org/pub/FreeBSD/packages/shells/bash-1.14.4.tgz).
189 Note: If you wish to use
193 ftp in such transfers, set
198 to some value in your environment. Otherwise, the more standard
199 ACTIVE mode may be used. If
201 consistently fails to fetch a package from a site known to work,
202 it may be because you have a firewall that demands the usage of
207 .Sh TECHNICAL DETAILS
209 is fairly simple. It extracts each package's "packing list"
210 into a special staging directory, parses it,
211 and then runs through the following sequence to fully extract the contents:
212 .Bl -enum -indent indent
214 Check if the package is already recorded as installed. If so,
215 terminate installation.
217 Scan all the package dependencies (from
221 and make sure each one is met. If not, try and find the missing
222 dependencies' packages and auto-install them; if they can't be found
223 the installation is terminated.
227 directives which control how the package is added to the system.
228 At the time of this writing, the only currently implemented option is
229 .Cm @option extract-in-place
230 which will cause the package to be extracted directly into its
231 prefix directory without moving through a staging area in
235 .Cm @option extract-in-place
236 is enabled, the package is now extracted directly into its
237 final location, otherwise it is extracted into the staging area.
239 If the package contains a
243 then execute it with the following arguments:
244 .Bd -filled -offset indent -compact
250 is the name of the package in question and the
252 keyword denotes this as an installation requirements check (useful if
253 you want to have one script serving multiple functions).
257 script exists for the package, it is then executed with the following
259 .Bd -filled -offset indent -compact
267 is the name of the package in question and
269 is a keyword denoting this as the preinstallation phase.
274 keyword will not appear if separate scripts for pre-install and post-install
275 are given during package creation time (using the
283 .Cm @option extract-in-place
284 is not used, then the packing list (this is the
286 file) is now used as a guide for moving (or copying, as necessary) files from
287 the staging area into their final locations.
289 If the package contains an
293 then mtree is invoked as:
294 .Bd -filled -offset indent -compact
306 is either the prefix specified with the
310 flag was specified, the name of the first directory named by a
312 directive within this package.
316 script exists for the package, it is then executed as
317 .Bd -filled -offset indent -compact
324 is the name of the package in question and
326 is a keyword denoting this as the post-installation phase.
331 keyword will not appear if separate scripts for pre-install and post-install
332 are given during package creation time (using the
339 Reasoning behind passing keywords such as
343 is that this allows you to write a single
345 script that does both
347 actions. But, separating the
348 functionality is more advantageous and easier from a maintainence viewpoint.
350 After installation is complete, a copy of the packing list,
352 script, description, and display files are copied into
353 .Pa /var/db/pkg/<pkg-name>
354 for subsequent possible use by
356 Any package dependencies are recorded in the other packages'
357 .Pa /var/db/pkg/<other-pkg>/+REQUIRED_BY
359 (if the environment variable PKG_DBDIR is set, this overrides the
363 Finally, the staging area is deleted and the program terminates.
366 All the scripts are called with the environment variable
368 set to the installation prefix (see the
370 option above). This allows a package author to write a script
371 that reliably performs some action on the directory where the package
372 is installed, even if the user might change it with the
379 is used if a given package can't be found. The environment variable
380 should be a series of entries seperated by colons. Each entry
381 consists of a directory name. The current directory may be indicated
382 implicitly by an empty directory name, or explicitly by a single
385 The environment variable
387 specifies an alternative location for the installed package database.
389 The environment variables
393 in that order, are taken to name temporary directories where
395 will attempt to create its staging area in.
396 If these variables are not present or if the directories named lack
397 sufficient space, then
399 will use the first of
404 with sufficient space.
406 The environment variable
408 specifies an alternate location for
410 to fetch from. This variable subverts the automatic directory logic
417 .Bl -tag -width /var/db/pkg -compact
419 Temporary directory for creating the staging area, if environmental variables
423 do not point to a suitable directory.
427 does not exist or has insufficient space.
433 are not suitable for creating the staging area.
435 Default location of the installed package database.
446 for initial work and ongoing development.
448 for NetBSD refinements.
450 Hard links between files in a distribution are only preserved if either
451 (1) the staging area is on the same file system as the target directory of
452 all the links to the file, or (2) all the links to the file are bracketed by
454 directives in the contents file,
456 the link names are extracted with a single
458 command (not split between
459 invocations due to exec argument-space limitations--this depends on the
461 .Fn sysconf _SC_ARG_MAX ) .