2 .\" FreeBSD install - a package for the installation and maintenance
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.
53 For extra protection, examine all
54 the package control files in the package record directory
55 .Pa ( /var/db/pkg/<pkg-name>/ ) .
56 Pay particular attention to any +INSTALL, +POST-INSTALL, +DEINSTALL,
57 +POST-DEINSTALL, +REQUIRE or +MTREE_DIRS files, and inspect the +CONTENTS
66 directives, and/or use the
68 command to examine the installed package control files.
71 The following command line options are supported:
72 .Bl -tag -width indent
74 The named packages are deinstalled.
76 Unconditionally delete all currently installed packages.
77 .It Fl i , -interactive
78 Request confirmation before attempting to delete each package,
79 regardless whether or not the standard input device is a
82 Turn on verbose output.
83 .It Fl D , -no-script , -no-scripts
84 If a deinstallation script exists for a given package, do not execute it.
86 Do not actually deinstall a package, just report the steps that
87 would be taken if it were.
88 .It Fl p , -prefix Ar prefix
91 as the directory in which to delete files from any installed packages
92 which do not explicitly set theirs.
93 For most packages, the prefix will
94 be set automatically to the installed location by
96 .It Fl d , -clean-dirs
97 Remove empty directories created by file cleanup.
99 files/directories explicitly listed in a package's contents (either as
100 normal files/directories or with the
102 directive) will be removed at deinstallation time.
105 to also remove any directories that were emptied as a result of removing
108 Force removal of the package, even if a dependency is recorded or the
109 deinstall or require script fails.
111 Do not try to expand shell glob patterns in the
113 when selecting packages to be deleted (by default
115 automatically expands shell glob patterns in the
120 as a regular expression and delete all packages whose names match
121 that regular expression.
122 Multiple regular expressions could be
123 provided, in that case
125 deletes all packages that match at least one
126 regular expression from the list.
132 as an extended regular expression.
133 .It Fl r , -recursive
135 In addition to specified packages, delete all
136 packages that depend on those packages as well.
138 .Sh TECHNICAL DETAILS
142 does pretty much what it says.
143 It examines installed package records in
144 .Pa /var/db/pkg/<pkg-name> ,
145 deletes the package contents, and finally removes the package records.
146 If the environment variable
148 is set, this overrides the
152 If a package is required by other installed packages,
154 will list those dependent packages and refuse to delete the package
159 If the package contains a
163 then this is executed first as
164 .Bd -ragged -offset indent -compact
171 is the name of the package in question and
173 is a keyword denoting that this is a deinstallation)
174 to see whether or not deinstallation should continue.
176 status means no, unless the
182 script exists for the package, it is executed before any files are removed.
183 It is this script's responsibility to clean up any additional messy details
184 around the package's installation, since all
186 knows how to do is delete the files created in the original distribution.
190 .Bd -ragged -offset indent -compact
197 is the name of the package in question and
199 is a keyword denoting this as the pre-deinstallation phase.
204 keyword will not appear if separate scripts for deinstall and post-deinstall
205 are given during package creation time (using the
214 script exists for the package, it is executed
216 all files are removed.
217 It is this script's responsibility to clean up any
218 additional messy details around the package's installation, and leave the
219 system (hopefully) in the same state that it was prior to the installation
225 .Bd -ragged -offset indent -compact
232 is the name of the package in question and
234 is a keyword denoting this as the post-deinstallation phase.
239 keyword will not appear if separate scripts for deinstall and post-deinstall
240 are given during package creation time (using the
247 Reasoning behind passing keywords such as
251 is that it lets you potentially write only one program/script that handles
252 all aspects of installation and deletion.
254 But experience has proved that this is a lot more difficult to maintain and
255 is not as advantageous as having separate scripts that handle each aspect of
256 installation and deinstallation.
258 All scripts are called with the environment variable
260 set to the installation prefix (see the
263 This allows a package author to write a script
264 that reliably performs some action on the directory where the package
265 is installed, even if the user might have changed it by specifying the
272 The environment variable
274 specifies an alternative location for the installed package database.
276 .Bl -tag -width /var/db/pkg -compact
278 Default location of the installed package database.
279 .It Ev PKG_OLD_NOWARN
282 will not warn about its use in the presence of pkgng databases.
294 .An John Kohl Aq jtk@rational.com ,
295 .An Oliver Eikemeier Aq eik@FreeBSD.org