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.31 2005/02/13 22:25:30 ru Exp $
19 .\" $DragonFly: src/usr.sbin/pkg_install/delete/pkg_delete.1,v 1.4 2005/03/08 20:11:30 joerg 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.
54 For extra protection, examine all
55 the package control files in the package record directory
56 .Pa ( /var/db/pkg/<pkg-name>/ ) .
57 Pay particular attention to any +INSTALL, +POST-INSTALL, +DEINSTALL,
58 +POST-DEINSTALL, +REQUIRE or +MTREE_DIRS files, and inspect the +CONTENTS
67 directives, and/or use the
69 command to examine the installed package control files.
72 The following command line options are supported:
73 .Bl -tag -width indent
75 The named packages are deinstalled.
77 Unconditionally delete all currently installed packages.
79 Request confirmation before attempting to delete each package,
80 regardless whether or not the standard input device is a
83 Turn on verbose output.
85 If a deinstallation script exists for a given package, do not execute it.
87 Do not actually deinstall a package, just report the steps that
88 would be taken if it were.
92 as the directory in which to delete files from any installed packages
93 which do not explicitly set theirs.
94 For most packages, the prefix will
95 be set automatically to the installed location by
98 Remove empty directories created by file cleanup.
100 files/directories explicitly listed in a package's contents (either as
101 normal files/directories or with the
103 directive) will be removed at deinstallation time.
106 to also remove any directories that were emptied as a result of removing
109 Force removal of the package, even if a dependency is recorded or the
110 deinstall or require script fails.
112 Do not try to expand shell glob patterns in the
114 when selecting packages to be deleted (by default
116 automatically expands shell glob patterns in the
121 as a regular expression and delete all packages whose names match
122 that regular expression.
123 Multiple regular expressions could be
124 provided, in that case
126 deletes all packages that match at least one
127 regular expression from the list.
133 as an extended regular expression.
136 In addition to specified packages, delete all
137 packages that depend on those packages as well.
139 .Sh TECHNICAL DETAILS
143 does pretty much what it says.
144 It examines installed package records in
145 .Pa /var/db/pkg/<pkg-name> ,
146 deletes the package contents, and finally removes the package records.
147 If the environment variable
149 is set, this overrides the
153 If a package is required by other installed packages,
155 will list those dependent packages and refuse to delete the package
160 If the package contains a
164 then this is executed first as
165 .Bd -ragged -offset indent -compact
172 is the name of the package in question and
174 is a keyword denoting that this is a deinstallation)
175 to see whether or not deinstallation should continue.
177 status means no, unless the
183 script exists for the package, it is executed before any files are removed.
184 It is this script's responsibility to clean up any additional messy details
185 around the package's installation, since all
187 knows how to do is delete the files created in the original distribution.
191 .Bd -ragged -offset indent -compact
198 is the name of the package in question and
200 is a keyword denoting this as the pre-deinstallation phase.
205 keyword will not appear if separate scripts for deinstall and post-deinstall
206 are given during package creation time (using the
215 script exists for the package, it is executed
217 all files are removed.
218 It is this script's responsibility to clean up any
219 additional messy details around the package's installation, and leave the
220 system (hopefully) in the same state that it was prior to the installation
226 .Bd -ragged -offset indent -compact
233 is the name of the package in question and
235 is a keyword denoting this as the post-deinstallation phase.
240 keyword will not appear if separate scripts for deinstall and post-deinstall
241 are given during package creation time (using the
248 Reasoning behind passing keywords such as
252 is that it lets you potentially write only one program/script that handles
253 all aspects of installation and deletion.
255 But experience has proved that this is a lot more difficult to maintain and
256 is not as advantageous as having separate scripts that handle each aspect of
257 installation and deinstallation.
259 All scripts are called with the environment variable
261 set to the installation prefix (see the
264 This allows a package author to write a script
265 that reliably performs some action on the directory where the package
266 is installed, even if the user might have changed it by specifying the
273 The environment variable
275 specifies an alternative location for the installed package database.
277 .Bl -tag -width /var/db/pkg -compact
279 Default location of the installed package database.
291 .An John Kohl Aq jtk@rational.com ,
292 .An Oliver Eikemeier Aq eik@FreeBSD.org