blob: b0d92e6a4229b09b12aa54a4abfb5e8e888fb224 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
.Dd September 27, 2026
.Dt DELPKG 8
.Os
.Sh NAME
.Nm delpkg
.Nd remove an installed package
.Sh SYNOPSIS
.Nm
.Op Fl f
.Op Fl r Ar root
.Ar package
.Nm
.Fl h | v
.Sh DESCRIPTION
.Nm
removes the installed package named
.Ar package .
It must be run as root.
.Pp
It refuses to remove a package that owns the modules of the running
kernel,
.Pa lib/modules/ Ns Ar release ,
or the last package owning anything under
.Pa lib/modules/ ,
since that would leave no bootable kernel.
The first check is only made when the root is
.Pa / .
.Pp
The removal runs these steps, in order:
.Bl -enum -offset indent
.It
Read the package metadata.
.It
Disable the declared services: remove the
.Pa /service/ Ns Ar name
link, then stop the service with
.Ic sv exit
if it is running.
.It
Remove the package's files, deepest first.
Files and directories that another package owns are kept.
Leftover
.Pa file.new
copies of its configuration files are removed as well.
.It
Remove the now empty service directories under
.Pa /etc/sv .
.It
Run
.Xr ldconfig 8
and the triggers described in
.Xr addpkg 8 .
.It
Remove the declared users, and the declared groups that no other
installed package declares.
Groups of the base system are never removed.
.It
Remove the package from the database.
.El
.Pp
The options are as follows:
.Bl -tag -width Ds
.It Fl f
Remove a kernel package despite the checks above.
.It Fl h
Print a usage summary.
.It Fl r Ar root
Remove from
.Ar root
instead of
.Pa / .
.It Fl v
Print the version.
.El
.Sh ENVIRONMENT
.Bl -tag -width PKG_DBDIR
.It Ev PKG_ROOT
Root if
.Fl r
is not given.
.It Ev PKG_DBDIR
Package database directory; see
.Xr addpkg 8 .
.El
.Sh FILES
.Bl -tag -width Ds -compact
.It Pa /var/lib/pkg/db
Package database.
.It Pa /var/lib/pkg/meta/ Ns Ar name
Package metadata.
.El
.Sh EXIT STATUS
.Ex -std
It fails if the files were removed but the database could not be
written.
.Sh SEE ALSO
.Xr addpkg 8 ,
.Xr infopkg 8 ,
.Xr pkg 8
|