xref: /openbsd/usr.sbin/pkg_add/pkg_delete.1 (revision 8932bfb7)
1.\"	$OpenBSD: pkg_delete.1,v 1.39 2011/07/12 10:51:28 espie Exp $
2.\"
3.\" Documentation and design originally from FreeBSD. All the code has
4.\" been rewritten since. We keep the documentation's notice:
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
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.
14.\"
15.\" Jordan K. Hubbard
16.\"
17.\"
18.Dd $Mdocdate: July 12 2011 $
19.Dt PKG_DELETE 1
20.Os
21.Sh NAME
22.Nm pkg_delete
23.Nd delete software package distributions
24.Sh SYNOPSIS
25.Nm pkg_delete
26.Op Fl acIimnqsvx
27.Op Fl B Ar pkg-destdir
28.Op Fl D Ar name Ns Op = Ns Ar value
29.Ar pkg-name Op Ar ...
30.Sh DESCRIPTION
31The
32.Nm
33command is used to delete packages that have been previously installed
34with the
35.Xr pkg_add 1
36command.
37.Pp
38Package names may be specified either as the package name itself, or as a
39filename which consists of the package name plus the
40.Dq .tgz
41suffix, or as a full pathname like
42.Pa /var/db/pkg/pkgname ,
43so that shell wildcards can be used.
44.Pp
45Version numbers and flavors
46.Po
47see
48.Xr packages-specs 7
49.Pc
50can be omitted, unless the resulting specification is ambiguous.
51.Pp
52The options are as follows:
53.Bl -tag -width BB-pkg-destdir
54.It Fl a
55Delete unused dependencies (packages that are not needed by anything tagged
56as installed manually).
57Don't use any
58.Ar pkg-name
59with this option.
60.It Fl B Ar pkg-destdir
61Set
62.Ar pkg-destdir
63as the prefix to prepend to any object deleted.
64.It Fl c
65Delete extra configuration file, mentioned as
66.Dl @extra file
67in the packing-list.
68.It Xo
69.Fl D
70.Ar name Ns Op = Ns Ar value
71.Xc
72Force removal of the package.
73.Ar name
74is a keyword that states what failsafe
75should be waived.
76Recognized keywords include:
77.Bl -tag -width "dependenciesXX"
78.It Ar baddepend
79force the deletion of packages even if they reference inexistent dependencies.
80.It Ar dependencies
81also delete the whole set of packages that depends upon the requested packages.
82.It Ar nonroot
83uninstall even if not running as root.
84.It Ar scripts
85external scripts may fail.
86.El
87.It Fl I
88If scripts exist for a given package, do not execute them.
89.It Fl i
90Switch on interactive mode.
91.Nm
92may ask questions to the user if faced with difficult decisions.
93.It Fl m
94Causes
95.Nm
96to always display the progress meter in cases it would not do so by default.
97.It Fl n
98Don't actually deinstall a package, just report the steps that
99would be taken if it were.
100.It Fl q
101Delete package quickly, do not bother with checksums before removing normal
102files.
103For signed packages, do not bother verifying signatures either.
104If used twice,
105it will not bother with checksums for configuration files either.
106.It Fl s
107Don't actually deinstall packages, report the disk size changes
108that would happen.
109.It Fl v
110Turn on verbose output.
111Several
112.Fl v
113turn on more verbose output.
114By default,
115.Nm
116is almost completely silent, but it reacts to keyboard status requests
117.Po
118see
119.Xr stty 1
120.Pc .
121.Fl v
122turns on basic messages,
123.Fl vv
124adds relevant system operations,
125.Fl vvv
126shows most internal computations apart from individual file/directory
127additions, and
128.Fl vvvvv
129shows everything.
130.It Fl x
131Disable progress meter.
132.El
133.Sh TECHNICAL DETAILS
134.Nm
135examines installed package records for the
136.Ar pkgname
137specified,  checks inter-dependencies between installed packages,
138deletes the package contents in an order respecting dependencies
139(e.g., packages with dependencies get removed first), and finally
140removes the package records.
141.Pp
142If a package is required by other installed packages not mentioned in
143the list of packages to remove,
144.Nm
145will list those dependent packages and refuse to delete the package.
146.Pp
147If a
148.Cm deinstall
149script exists for the package (deprecated,
150.Cm @unexec
151is more versatile),
152it is executed before any files are removed.
153Such a script can be used to remove messy dynamic files created by the
154package on installation or during usage.
155The
156.Nm deinstall
157script is called as:
158.Bd -filled -offset indent
159.Cm deinstall
160.Ar <pkg-name>
161.Ar DEINSTALL
162.Ed
163.Pp
164Passing the keyword
165.Ar DEINSTALL
166lets you potentially write only one program/script that handles all
167aspects of installation and deletion.
168.Sh ENVIRONMENT
169.Bl -tag -width PKG_DESTDIR
170.It Ev PKG_DBDIR
171Where to look for installed packages instead of
172.Pa /var/db/pkg .
173.It Ev PKG_DESTDIR
174Value for
175.Ar pkg-destdir ,
176if no
177.Fl B
178option is specified;
179value passed to any
180.Cm DEINSTALL
181or
182.Cm REQUIRE
183script invoked from the package.
184.El
185.Sh SEE ALSO
186.Xr pkg_add 1 ,
187.Xr pkg_create 1 ,
188.Xr pkg_info 1 ,
189.Xr pkg.conf 5 ,
190.Xr packages-specs 7
191.Sh AUTHORS
192.Bl -tag -width indent -compact
193.It "Jordan Hubbard"
194initial design
195.It "Marc Espie"
196complete rewrite
197.El
198