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 $
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.
123 Recursive removal. In addition to specified packages, delete all
124 packages that depend on those packages as well.
126 .Sh TECHNICAL DETAILS
130 does pretty much what it says. It examines installed package records in
131 .Pa /var/db/pkg/<pkg-name> ,
132 deletes the package contents, and finally removes the package records.
133 If the environment variable
135 is set, this overrides the
139 If a package is required by other installed packages,
141 will list those dependent packages and refuse to delete the package
146 If the package contains a
150 then this is executed first as
151 .Bd -ragged -offset indent -compact
158 is the name of the package in question and
160 is a keyword denoting that this is a deinstallation)
161 to see whether or not deinstallation should continue. A non-zero exit
162 status means no, unless the
168 script exists for the package, it is executed before any files are removed.
169 It is this script's responsibility to clean up any additional messy details
170 around the package's installation, since all
172 knows how to do is delete the files created in the original distribution.
176 .Bd -ragged -offset indent -compact
183 is the name of the package in question and
185 is a keyword denoting this as the pre-deinstallation phase.
190 keyword will not appear if separate scripts for deinstall and post-deinstall
191 are given during package creation time (using the
200 script exists for the package, it is executed
202 all files are removed. It is this script's responsibility to clean up any
203 additional messy details around the package's installation, and leave the
204 system (hopefully) in the same state that it was prior to the installation
210 .Bd -ragged -offset indent -compact
217 is the name of the package in question and
219 is a keyword denoting this as the post-deinstallation phase.
224 keyword will not appear if separate scripts for deinstall and post-deinstall
225 are given during package creation time (using the
232 Reasoning behind passing keywords such as
236 is that it lets you potentially write only one program/script that handles
237 all aspects of installation and deletion.
239 But experience has proved that this is a lot more difficult to maintain and
240 is not as advantageous as having separate scripts that handle each aspect of
241 installation and deinstallation.
243 All scripts are called with the environment variable
245 set to the installation prefix (see the
247 option above). This allows a package author to write a script
248 that reliably performs some action on the directory where the package
249 is installed, even if the user might have changed it by specifying the
256 The environment variable
258 specifies an alternative location for the installed package database.
260 .Bl -tag -width /var/db/pkg -compact
262 Default location of the installed package database.
274 .An John Kohl Aq jtk@rational.com