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 deleting previously installed software package distributions
37 command is used to delete packages that have been previously installed
45 command may execute scripts or programs provided by a package file,
46 your system may be susceptible to
49 attacks from miscreants who create dangerous package files.
51 You are advised to verify the competence and identity of those who
52 provide installable package files. For extra protection, examine all
53 the package control files in the package record directory
54 .Pa ( /var/db/pkg/<pkg-name>/ ) .
55 Pay particular attention to any +INSTALL, +POST-INSTALL, +DEINSTALL,
56 +POST-DEINSTALL, +REQUIRE or +MTREE_DIRS files, and inspect the +CONTENTS
65 directives, and/or use the
67 command to examine the installed package control files.
70 The following command line options are supported:
71 .Bl -tag -width indent
73 The named packages are deinstalled.
75 Unconditionally delete all currently installed packages.
77 Request confirmation before attempting to delete each package,
78 regardless whether or not the standard input device is a
81 Turn on verbose output.
83 If a deinstallation script exists for a given package, do not execute it.
85 Don't actually deinstall a package, just report the steps that
86 would be taken if it were.
90 as the directory in which to delete files from any installed packages
91 which do not explicitly set theirs. For most packages, the prefix will
92 be set automatically to the installed location by
95 Remove empty directories created by file cleanup. By default, only
96 files/directories explicitly listed in a package's contents (either as
97 normal files/directories or with the
99 directive) will be removed at deinstallation time. This option tells
101 to also remove any directories that were emptied as a result of removing
104 Force removal of the package, even if a dependency is recorded or the
105 deinstall or require script fails.
107 Do not try to expand shell glob patterns in the
109 when selecting packages to be deleted (by default
111 automatically expands shell glob patterns in the
116 as a regular expression and delete all packages whose names match
117 that regular expression. Multiple regular expressions could be
118 provided, in that case
120 deletes all packages that match at least one
121 regular expression from the list.
127 as an extended regular expression.
129 Recursive removal. In addition to specified packages, delete all
130 packages that depend on those packages as well.
132 .Sh TECHNICAL DETAILS
136 does pretty much what it says. It examines installed package records in
137 .Pa /var/db/pkg/<pkg-name> ,
138 deletes the package contents, and finally removes the package records.
139 If the environment variable
141 is set, this overrides the
145 If a package is required by other installed packages,
147 will list those dependent packages and refuse to delete the package
152 If the package contains a
156 then this is executed first as
157 .Bd -ragged -offset indent -compact
164 is the name of the package in question and
166 is a keyword denoting that this is a deinstallation)
167 to see whether or not deinstallation should continue. A non-zero exit
168 status means no, unless the
174 script exists for the package, it is executed before any files are removed.
175 It is this script's responsibility to clean up any additional messy details
176 around the package's installation, since all
178 knows how to do is delete the files created in the original distribution.
182 .Bd -ragged -offset indent -compact
189 is the name of the package in question and
191 is a keyword denoting this as the pre-deinstallation phase.
196 keyword will not appear if separate scripts for deinstall and post-deinstall
197 are given during package creation time (using the
206 script exists for the package, it is executed
208 all files are removed. It is this script's responsibility to clean up any
209 additional messy details around the package's installation, and leave the
210 system (hopefully) in the same state that it was prior to the installation
216 .Bd -ragged -offset indent -compact
223 is the name of the package in question and
225 is a keyword denoting this as the post-deinstallation phase.
230 keyword will not appear if separate scripts for deinstall and post-deinstall
231 are given during package creation time (using the
238 Reasoning behind passing keywords such as
242 is that it lets you potentially write only one program/script that handles
243 all aspects of installation and deletion.
245 But experience has proved that this is a lot more difficult to maintain and
246 is not as advantageous as having separate scripts that handle each aspect of
247 installation and deinstallation.
249 All scripts are called with the environment variable
251 set to the installation prefix (see the
253 option above). This allows a package author to write a script
254 that reliably performs some action on the directory where the package
255 is installed, even if the user might have changed it by specifying the
262 The environment variable
264 specifies an alternative location for the installed package database.
266 .Bl -tag -width /var/db/pkg -compact
268 Default location of the installed package database.
280 .An John Kohl Aq jtk@rational.com ,
281 .An Oliver Eikemeier Aq eik@FreeBSD.org