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.
18 .\" $FreeBSD: src/usr.sbin/pkg_install/delete/pkg_delete.1,v 1.16.2.9 2002/06/21 16:42:18 charnier Exp $
19 .\" $DragonFly: src/usr.sbin/pkg_install/delete/Attic/pkg_delete.1,v 1.2 2003/06/17 04:29:59 dillon Exp $
26 .Nd a utility for deleting previously installed software package distributions
38 command is used to delete packages that have been previously installed
46 command may execute scripts or programs provided by a package file,
47 your system may be susceptible to
50 attacks from miscreants who create dangerous package files.
52 You are advised to verify the competence and identity of those who
53 provide installable package files. 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.
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.
84 If a deinstallation script exists for a given package, do not execute it.
86 Don't actually deinstall a package, just report the steps that
87 would be taken if it were.
91 as the directory in which to delete files from any installed packages
92 which do not explicitly set theirs. For most packages, the prefix will
93 be set automatically to the installed location by
96 Remove empty directories created by file cleanup. By default, only
97 files/directories explicitly listed in a package's contents (either as
98 normal files/directories or with the
100 directive) will be removed at deinstallation time. This option tells
102 to also remove any directories that were emptied as a result of removing
105 Force removal of the package, even if a dependency is recorded or the
106 deinstall or require script fails.
108 Do not try to expand shell glob patterns in the
110 when selecting packages to be deleted (by default
112 automatically expands shell glob patterns in the
117 as a regular expression and delete all packages whose names match
118 that regular expression. Multiple regular expressions could be
119 provided, in that case
121 deletes all packages that match at least one
122 regular expression from the list.
124 Recursive removal. In addition to specified packages, delete all
125 packages that depend on those packages as well.
127 .Sh TECHNICAL DETAILS
131 does pretty much what it says. It examines installed package records in
132 .Pa /var/db/pkg/<pkg-name> ,
133 deletes the package contents, and finally removes the package records.
134 If the environment variable
136 is set, this overrides the
140 If a package is required by other installed packages,
142 will list those dependent packages and refuse to delete the package
147 If the package contains a
151 then this is executed first as
152 .Bd -ragged -offset indent -compact
159 is the name of the package in question and
161 is a keyword denoting that this is a deinstallation)
162 to see whether or not deinstallation should continue. A non-zero exit
163 status means no, unless the
169 script exists for the package, it is executed before any files are removed.
170 It is this script's responsibility to clean up any additional messy details
171 around the package's installation, since all
173 knows how to do is delete the files created in the original distribution.
177 .Bd -ragged -offset indent -compact
184 is the name of the package in question and
186 is a keyword denoting this as the pre-deinstallation phase.
191 keyword will not appear if separate scripts for deinstall and post-deinstall
192 are given during package creation time (using the
201 script exists for the package, it is executed
203 all files are removed. It is this script's responsibility to clean up any
204 additional messy details around the package's installation, and leave the
205 system (hopefully) in the same state that it was prior to the installation
211 .Bd -ragged -offset indent -compact
218 is the name of the package in question and
220 is a keyword denoting this as the post-deinstallation phase.
225 keyword will not appear if separate scripts for deinstall and post-deinstall
226 are given during package creation time (using the
233 Reasoning behind passing keywords such as
237 is that it lets you potentially write only one program/script that handles
238 all aspects of installation and deletion.
240 But experience has proved that this is a lot more difficult to maintain and
241 is not as advantageous as having separate scripts that handle each aspect of
242 installation and deinstallation.
244 All scripts are called with the environment variable
246 set to the installation prefix (see the
248 option above). This allows a package author to write a script
249 that reliably performs some action on the directory where the package
250 is installed, even if the user might have changed it by specifying the
257 The environment variable
259 specifies an alternative location for the installed package database.
261 .Bl -tag -width /var/db/pkg -compact
263 Default location of the installed package database.
275 .An John Kohl Aq jtk@rational.com