pkg_delete - a utility for deleting previously installed
software package
distributions
pkg_delete [-cDnqv] [-B pkg-destdir] [-f keys] pkgname [...]
The pkg_delete command is used to delete packages that have
been previously
installed with the pkg_add(1) command.
Package names may be specified either as the package name
itself, or as a
filename which consists of the package name plus the
``.tgz'' suffix, or
as a full pathname like /var/db/pkg/pkgname, so that shell
wildcards can
be used.
Version numbers and flavors (see packages-specs(7)) can be
omitted, unless
the resulting specification is ambiguous.
The options are as follows:
-B pkg-destdir Set pkg-destdir as the prefix to prepend to
any object
deleted.
-v Turn on verbose output.
-D If a deinstallation script exists for a given package, do
not execute it.
-n Don't actually deinstall a package, just report the steps
that would be taken if it were.
-f keys Force removal of the package. keys is a
comma-separated
list of keywords that state what failsafes
should be
waived. These include:
ambiguous
delete all packages matching ambiguous package
specifications.
dependencies
also delete the whole set of packages that depends
upon the requested packages.
nonroot uninstall even if not running as
root.
uninstalled
proceed even if some package names
don't resolve
to installed package names.
-c Delete extra configuration file, mentioned
as
@extra file
in the packing-list.
-q Delete package quickly, do not bother checking md5s before
removing files.
pkg_delete examines installed package records for the
pkgname specified,
checks inter-dependencies between installed packages,
deletes the package
contents in an order respecting dependencies (e.g., packages
with dependencies
get removed first), and finally removes the package
records.
If a package is required by other installed packages not
mentioned in the
list of packages to remove, pkg_delete will list those dependent packages
and refuse to delete the package.
If the package contains a require file (see pkg_create(1)),
then this is
executed first as
require <pkg-name> DEINSTALL
(where pkgname is the name of the package in question and
DEINSTALL is a
keyword denoting that this is a deinstallation) to see
whether or not deinstallation
should continue. A non-zero exit status means
no, unless
the -f option is specified.
If a deinstall script exists for the package, it is executed
before any
files are removed. Such a script can be used to remove
messy dynamic
files created by the package on installation or during usage. The
deinstall script is called as:
deinstall <pkg-name> DEINSTALL
Passing the keyword DEINSTALL lets you potentially write only one program/script
that handles all aspects of installation and
deletion.
PKG_DBDIR Where to look for installed packages instead of
/var/db/pkg.
PKG_DESTDIR Value for pkg-destdir, if no -B option is specified; value
passed to any DEINSTALL or REQUIRE script invoked from the
package.
pkg_add(1), pkg_create(1), pkg_info(1), mkstemp(3), mtree(8)
Jordan Hubbard
initial design
Marc Espie
complete rewrite
OpenBSD 3.6 November 25, 1994
[ Back ] |