summaryrefslogtreecommitdiff
path: root/pkgtools/pkg_install/files/delete/pkg_delete.cat1
blob: 91c2c00298f995b16e4766699b6420b45e7ec0cb (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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
PKG_DELETE(1)           NetBSD General Commands Manual           PKG_DELETE(1)

NNAAMMEE
     ppkkgg__ddeelleettee -- a utility for deleting previously installed software pack-
     age distributions

SSYYNNOOPPSSIISS
     ppkkgg__ddeelleettee [--DDddFFffNNnnOORRrrVVvv] [--KK _p_k_g___d_b_d_i_r] [--pp _p_r_e_f_i_x] _p_k_g_-_n_a_m_e _._._.

DDEESSCCRRIIPPTTIIOONN
     The ppkkgg__ddeelleettee command is used to delete packages that have been previ-
     ously installed with the pkg_add(1) command.

WWAARRNNIINNGG
     _S_i_n_c_e _t_h_e ppkkgg__ddeelleettee _c_o_m_m_a_n_d _m_a_y _e_x_e_c_u_t_e _s_c_r_i_p_t_s _o_r _p_r_o_g_r_a_m_s _p_r_o_v_i_d_e_d _b_y
     _a _p_a_c_k_a_g_e _f_i_l_e_, _y_o_u_r _s_y_s_t_e_m _m_a_y _b_e _s_u_s_c_e_p_t_i_b_l_e _t_o _`_`_T_r_o_j_a_n _h_o_r_s_e_s_'_' _o_r
     _o_t_h_e_r _s_u_b_t_l_e _a_t_t_a_c_k_s _f_r_o_m _m_i_s_c_r_e_a_n_t_s _w_h_o _c_r_e_a_t_e _d_a_n_g_e_r_o_u_s _p_a_c_k_a_g_e _f_i_l_e_s_.

     _Y_o_u _a_r_e _a_d_v_i_s_e_d _t_o _v_e_r_i_f_y _t_h_e _c_o_m_p_e_t_e_n_c_e _a_n_d _i_d_e_n_t_i_t_y _o_f _t_h_o_s_e _w_h_o _p_r_o_-
     _v_i_d_e _i_n_s_t_a_l_l_a_b_l_e _p_a_c_k_a_g_e _f_i_l_e_s_.  _F_o_r _e_x_t_r_a _p_r_o_t_e_c_t_i_o_n_, _e_x_a_m_i_n_e _a_l_l _t_h_e
     _p_a_c_k_a_g_e _c_o_n_t_r_o_l _f_i_l_e_s _i_n _t_h_e _p_a_c_k_a_g_e _r_e_c_o_r_d _d_i_r_e_c_t_o_r_y
     _(_/_v_a_r_/_d_b_/_p_k_g_/_<_p_k_g_-_n_a_m_e_>_/_)_.  _P_a_y _p_a_r_t_i_c_u_l_a_r _a_t_t_e_n_t_i_o_n _t_o _a_n_y _+_I_N_S_T_A_L_L _o_r
     _+_D_E_I_N_S_T_A_L_L _f_i_l_e_s_, _a_n_d _i_n_s_p_e_c_t _t_h_e _+_C_O_N_T_E_N_T_S _f_i_l_e _f_o_r @@ccwwdd_, @@mmooddee _(_c_h_e_c_k
     _f_o_r _s_e_t_u_i_d_)_, @@ddiirrrrmm_, @@eexxeecc_, _a_n_d @@uunneexxeecc _d_i_r_e_c_t_i_v_e_s_, _a_n_d_/_o_r _u_s_e _t_h_e
     pkg_info(_1) _c_o_m_m_a_n_d _t_o _e_x_a_m_i_n_e _t_h_e _i_n_s_t_a_l_l_e_d _p_a_c_k_a_g_e _c_o_n_t_r_o_l _f_i_l_e_s_.

OOPPTTIIOONNSS
     The following command line options are supported:

     _p_k_g_-_n_a_m_e _._._.
             The named packages are deinstalled, wildcards can be used, see
             pkg_info(1).  If no version is given, the one currently installed
             will be removed.  If the --FF flag is given, one or more (absolute)
             filenames may be specified and the Package Database will be con-
             sulted for the package to which the given file belongs.  These
             packages are then deinstalled.

     --DD      If a deinstallation script exists for a given package, do not
             execute it.

     --dd      Remove empty directories created by file cleanup.  By default,
             only files/directories explicitly listed in a package's contents
             (either as normal files/directories or with the @@ddiirrrrmm directive)
             will be removed at deinstallation time.  This option tells
             ppkkgg__ddeelleettee to also remove any directories that were emptied as a
             result of removing the package.

     --FF      Any pkg-name given will be interpreted as pathname which is sub-
             sequently transformed in a (real) package name via the Package
             Database.  That way, packages can be deleted by giving a filename
             instead of the package-name.

     --ff      Force removal of the package, even if a dependency is recorded or
             the deinstall script fails.

     --ffff     Force removal of the package, even if the package is marked as a
             pprreesseerrvveedd package.  Note that this is a dangerous operation.

     --KK _p_k_g___d_b_d_i_r
             Set _p_k_g___d_b_d_i_r as the package database directory.  If this option
             isn't specified, then the package database directory is taken
             from the value of the environment variable PKG_DBDIR if it's set,
             otherwise it defaults to _/_v_a_r_/_d_b_/_p_k_g.

     --NN      Remove the package's registration and its entries from the pack-
             age database, but leave the files installed.  Don't run any dein-
             stall scripts or @unexec lines either.

     --nn      Don't actually deinstall a package, just report the steps that
             would be taken if it were.

     --OO      Only delete the package's entries from the package database, do
             not touch the package or its files itself.

     --pp _p_r_e_f_i_x
             Set _p_r_e_f_i_x as the directory in which to delete files from any
             installed packages which do not explicitly set theirs.  For most
             packages, the prefix will be set automatically to the installed
             location by pkg_add(1).

     --RR      This option triggers a recursive delete of the given package and
             any packages it depends on, unless some other package still needs
             a dependent package.  This --RR option can be used to clean up by
             deleting a package and all its then-unneeded dependent packages.

     --rr      ppkkgg__ddeelleettee first builds a list of all packages that require
             (directly and indirectly) the one being deleted.  It then deletes
             these packages using ppkkgg__ddeelleettee with the given options before
             deleting the user specified package.  This --rr option can be used
             to recursively delete a package and all of the packages which
             depend on that package.

     --VV      Print version number and exit.

     --vv      Turn on verbose output.

TTEECCHHNNIICCAALL DDEETTAAIILLSS
     ppkkgg__ddeelleettee does pretty much what it says.  It examines installed package
     records in _/_v_a_r_/_d_b_/_p_k_g_/_<_p_k_g_-_n_a_m_e_>, deletes the package contents, and
     finally removes the package records (if an alternate package database
     directory is specified, then it overrides the _/_v_a_r_/_d_b_/_p_k_g path shown
     above).

     If a package is required by other installed packages, ppkkgg__ddeelleettee will
     list those dependent packages and refuse to delete the package (unless
     the --ff option is given).

     If a package has been marked as a pprreesseerrvveedd package, it will not be able
     to be deleted (unless more than one occurrence of the --ff option is
     given).

     If a filename is given instead of a package name, the package of which
     the given file belongs to can be deleted if the --FF Flag is given.  The
     filename needs to be absolute, see the output produced by the pkg_info
     --aaFF command.

     If a ddeeiinnssttaallll script exists for the package, it is executed before and
     after any files are removed.  It is this script's responsibility to clean
     up any additional messy details around the package's installation, since
     all ppkkgg__ddeelleettee knows how to do is delete the files created in the origi-
     nal distribution.  The ddeeiinnssttaallll script is called as:
           ddeeiinnssttaallll <_p_k_g_-_n_a_m_e> _V_I_E_W_-_D_E_I_N_S_T_A_L_L
     before removing the package from a view, and as:
           ddeeiinnssttaallll <_p_k_g_-_n_a_m_e> _D_E_I_N_S_T_A_L_L
     before deleting all files and as:
           ddeeiinnssttaallll <_p_k_g_-_n_a_m_e> _P_O_S_T_-_D_E_I_N_S_T_A_L_L
     after deleting them.  Passing the keywords _V_I_E_W_-_D_E_I_N_S_T_A_L_L, _D_E_I_N_S_T_A_L_L and
     _P_O_S_T_-_D_E_I_N_S_T_A_L_L lets you potentially write only one program/script that
     handles all aspects of installation and deletion.

     All scripts are called with the environment variable PKG_PREFIX set to
     the installation prefix (see the --pp option above).  This allows a package
     author to write a script that reliably performs some action on the direc-
     tory where the package is installed, even if the user might have changed
     it by specifying the --pp option when running ppkkgg__ddeelleettee or pkg_add(1).
     The scripts are also called with the PKG_METADATA_DIR environment vari-
     able set to the location of the _+_* meta-data files, and with the
     PKG_REFCOUNT_DBDIR environment variable set to the location of the pack-
     age reference counts database directory.

EENNVVIIRROONNMMEENNTT
     PKG_DBDIR  If the --KK flag isn't given, then PKG_DBDIR is the location of
                the package database directory.  The default package database
                directory is _/_v_a_r_/_d_b_/_p_k_g.

     PKG_REFCOUNT_DBDIR
                Location of the package reference counts database directory.
                The default location is the path to the package database
                directory with ``.refcount'' appended to the path, e.g.
                _/_v_a_r_/_d_b_/_p_k_g_._r_e_f_c_o_u_n_t.

SSEEEE AALLSSOO
     pkg_add(1), pkg_admin(1), pkg_create(1), pkg_info(1), mktemp(3),
     pkgsrc(7)

AAUUTTHHOORRSS
     Jordan Hubbard
             most of the work
     John Kohl
             refined it for NetBSD
     Hubert Feyrer
             NetBSD wildcard dependency processing, pkgdb, recursive "down"
             delete, etc.

NetBSD 4.0                       March 2, 2007                      NetBSD 4.0