1 .\" $NetBSD: pkg_delete.1,v 1.1.1.8 2010/04/23 20:54:08 joerg Exp $
3 .\" FreeBSD install - a package for the installation and maintenance
4 .\" of non-core utilities.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
18 .\" from FreeBSD: @(#)pkg_delete.1
25 .Nd a utility for deleting previously installed software package distributions
36 command is used to delete packages that have been previously installed
40 The given packages are sorted, so that the dependencies needed by a
41 package are deleted after the package.
42 Before any action is executed,
44 checks for packages that are marked as
46 or have depending packages left.
49 flag is given, preserved packages are skipped and not removed.
54 stops on the first error.
59 command may execute scripts or programs provided by a package file,
60 your system may be susceptible to
63 attacks from miscreants who create dangerous package files.
65 You are advised to verify the competence and identity of those who
66 provide installable package files.
67 For extra protection, examine all the package control files in the
68 package record directory
69 .Pa \*[Lt]PKG_DBDIR\*[Gt]/\*[Lt]pkg-name\*[Gt]/ ) .
75 files, and inspect the
85 directives, and/or use the
87 command to examine the installed package control files.
90 The following command line options are supported:
91 .Bl -tag -width indent
93 The named packages are deinstalled, wildcards can be used, see
95 If no version is given, the one currently installed
99 flag is given, one or more (absolute) filenames may be specified and
100 the package database will be consulted for the package to which the
102 These packages are then deinstalled.
104 Recursively remove all automatically installed packages that were needed
105 by the given packages and are no longer required.
106 Does not remove manually installed packages; see also the
110 If a deinstallation script exists for a given package, do not execute it.
114 given will be interpreted as pathname which is
115 subsequently transformed in a (real) package name via the package
117 That way, packages can be deleted by giving a filename
118 instead of the package-name.
120 Force removal of the package, even if a dependency is recorded or the
121 deinstall script fails.
122 This might break the package database; see
126 Force removal of the package, even if the package is marked as a
129 Note that this is a dangerous operation.
133 .It Fl K Ar pkg_dbdir
134 Override the value of the
136 configuration option with the value
139 Silently skip all packages that are marked as
142 Remove the package's registration and its entries from the package database,
143 but leave the files installed.
144 Don't run any deinstall scripts or
148 Don't actually deinstall a package, just report the steps that
151 Only delete the package's entries from the package database; do not
152 touch the package or its files itself.
154 Prefix all file and directory names with
156 For packages without install scripts this has the same behavior as
162 as the directory in which to delete files from any installed packages
163 which do not explicitly set theirs.
164 For most packages, the prefix will
165 be set automatically to the installed location by
168 Recursively remove all packages that were needed by the given packages
169 and are no longer required.
170 This option overrides the
174 Recursively remove all packages that require one of the packages given.
176 Print version number and exit.
178 Turn on verbose output.
180 .Sh TECHNICAL DETAILS
182 does pretty much what it says.
183 It examines installed package records in
184 .Pa \*[Lt]PKG_DBDIR\*[Gt]/\*[Lt]pkg-name\*[Gt] ,
185 deletes the package contents, and finally removes the package records.
187 If a package is required by other installed packages,
189 will list those dependent packages and refuse to delete the package
194 If a package has been marked as a
196 package, it will not be able to be deleted
197 (unless more than one occurrence of the
201 If a filename is given instead of a package name, the package of which
202 the given file belongs to can be deleted if the
205 The filename needs to be absolute, see the output produced by the
212 script exists for the package, it is executed before and after
213 any files are removed.
214 It is this script's responsibility to clean up any additional messy details
215 around the package's installation, since all
217 knows how to do is delete the files created in the original distribution.
221 .Bd -filled -offset indent -compact
226 before removing the package from a view, and as:
227 .Bd -filled -offset indent -compact
232 before deleting all files and as:
233 .Bd -filled -offset indent -compact
244 lets you potentially write only one program/script that handles all
245 aspects of installation and deletion.
247 All scripts are called with the environment variable
249 set to the installation prefix (see the
252 This allows a package author to write a script
253 that reliably performs some action on the directory where the package
254 is installed, even if the user might have changed it by specifying the
260 The scripts are also called with the
262 environment variable set to the location of the
264 meta-data files, and with the
265 .Ev PKG_REFCOUNT_DBDIR
266 environment variable set to the location of the package reference counts
277 .Xr pkg_install.conf 5
278 for options, that can also be specified using the environment.
284 .Xr pkg_install.conf 5
287 .Bl -tag -width indent -compact
295 wildcard dependency processing, pkgdb, recursive "down"
297 .It Joerg Sonnenberger
298 Rewrote most of the code to compute correct order of deinstallation
299 and to improve error handling.