| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | .\" $NetBSD: pkg_delete.1,v 1.26 2010/01/22 13:30:41 joerg Exp $ | | 1 | .\" $NetBSD: pkg_delete.1,v 1.27 2010/02/24 21:11:27 wiz Exp $ |
2 | .\" | | 2 | .\" |
3 | .\" FreeBSD install - a package for the installation and maintenance | | 3 | .\" FreeBSD install - a package for the installation and maintenance |
4 | .\" of non-core utilities. | | 4 | .\" of non-core utilities. |
5 | .\" | | 5 | .\" |
6 | .\" Redistribution and use in source and binary forms, with or without | | 6 | .\" Redistribution and use in source and binary forms, with or without |
7 | .\" modification, are permitted provided that the following conditions | | 7 | .\" modification, are permitted provided that the following conditions |
8 | .\" are met: | | 8 | .\" are met: |
9 | .\" 1. Redistributions of source code must retain the above copyright | | 9 | .\" 1. Redistributions of source code must retain the above copyright |
10 | .\" notice, this list of conditions and the following disclaimer. | | 10 | .\" notice, this list of conditions and the following disclaimer. |
11 | .\" 2. Redistributions in binary form must reproduce the above copyright | | 11 | .\" 2. Redistributions in binary form must reproduce the above copyright |
12 | .\" notice, this list of conditions and the following disclaimer in the | | 12 | .\" notice, this list of conditions and the following disclaimer in the |
13 | .\" documentation and/or other materials provided with the distribution. | | 13 | .\" documentation and/or other materials provided with the distribution. |
14 | .\" | | 14 | .\" |
| @@ -16,52 +16,47 @@ | | | @@ -16,52 +16,47 @@ |
16 | .\" | | 16 | .\" |
17 | .\" | | 17 | .\" |
18 | .\" from FreeBSD: @(#)pkg_delete.1 | | 18 | .\" from FreeBSD: @(#)pkg_delete.1 |
19 | .\" | | 19 | .\" |
20 | .Dd January 20, 2010 | | 20 | .Dd January 20, 2010 |
21 | .Dt PKG_DELETE 1 | | 21 | .Dt PKG_DELETE 1 |
22 | .Os | | 22 | .Os |
23 | .Sh NAME | | 23 | .Sh NAME |
24 | .Nm pkg_delete | | 24 | .Nm pkg_delete |
25 | .Nd a utility for deleting previously installed software package distributions | | 25 | .Nd a utility for deleting previously installed software package distributions |
26 | .Sh SYNOPSIS | | 26 | .Sh SYNOPSIS |
27 | .Nm | | 27 | .Nm |
28 | .Op Fl ADFfkNnORrVv | | 28 | .Op Fl ADFfkNnORrVv |
29 | .Bk -words | | | |
30 | .Op Fl K Ar pkg_dbdir | | 29 | .Op Fl K Ar pkg_dbdir |
31 | .Ek | | | |
32 | .Bk -words | | | |
33 | .Op Fl P Ar destdir | | 30 | .Op Fl P Ar destdir |
34 | .Op Fl p Ar prefix | | 31 | .Op Fl p Ar prefix |
35 | .Ek | | | |
36 | .Ar pkg-name ... | | 32 | .Ar pkg-name ... |
37 | .Sh DESCRIPTION | | 33 | .Sh DESCRIPTION |
38 | The | | 34 | The |
39 | .Nm | | 35 | .Nm |
40 | command is used to delete packages that have been previously installed | | 36 | command is used to delete packages that have been previously installed |
41 | with the | | 37 | with the |
42 | .Xr pkg_add 1 | | 38 | .Xr pkg_add 1 |
43 | command. | | 39 | command. |
44 | The given packages are sorted, so that the dependencies of a package | | 40 | The given packages are sorted, so that the dependencies needed by a |
45 | are deleted after the package. | | 41 | package are deleted after the package. |
46 | Before any action is executed, | | 42 | Before any action is executed, |
47 | .Nm | | 43 | .Nm |
48 | checks for packages that are marked as | | 44 | checks for packages that are marked as |
49 | .Cm preserved | | 45 | .Cm preserved |
50 | or have depending packages left. | | 46 | or have depending packages left. |
51 | If the | | 47 | If the |
52 | .Fl k | | 48 | .Fl k |
53 | flag is given, preserved packages are removed from the list of packages | | 49 | flag is given, preserved packages are skipped and not removed. |
54 | to remove. | | | |
55 | Unless the | | 50 | Unless the |
56 | .Fl f | | 51 | .Fl f |
57 | flag is given, | | 52 | flag is given, |
58 | .Nm | | 53 | .Nm |
59 | stops on the first error. | | 54 | stops on the first error. |
60 | .Sh WARNING | | 55 | .Sh WARNING |
61 | .Bf -emphasis | | 56 | .Bf -emphasis |
62 | Since the | | 57 | Since the |
63 | .Nm | | 58 | .Nm |
64 | command may execute scripts or programs provided by a package file, | | 59 | command may execute scripts or programs provided by a package file, |
65 | your system may be susceptible to | | 60 | your system may be susceptible to |
66 | .Dq Trojan horses | | 61 | .Dq Trojan horses |
67 | or other subtle | | 62 | or other subtle |
| @@ -104,76 +99,80 @@ If the | | | @@ -104,76 +99,80 @@ If the |
104 | flag is given, one or more (absolute) filenames may be specified and | | 99 | flag is given, one or more (absolute) filenames may be specified and |
105 | the Package Database will be consulted for the package to which the | | 100 | the Package Database will be consulted for the package to which the |
106 | given file belongs. | | 101 | given file belongs. |
107 | These packages are then deinstalled. | | 102 | These packages are then deinstalled. |
108 | .It Fl A | | 103 | .It Fl A |
109 | Recursively remove all automatically installed packages that were needed | | 104 | Recursively remove all automatically installed packages that were needed |
110 | by the given packages and are no longer required. | | 105 | by the given packages and are no longer required. |
111 | See also the | | 106 | See also the |
112 | .Fl R | | 107 | .Fl R |
113 | flag. | | 108 | flag. |
114 | .It Fl D | | 109 | .It Fl D |
115 | If a deinstallation script exists for a given package, do not execute it. | | 110 | If a deinstallation script exists for a given package, do not execute it. |
116 | .It Fl F | | 111 | .It Fl F |
117 | Any pkg-name given will be interpreted as pathname which is | | 112 | Any |
| | | 113 | .Ar pkg-name |
| | | 114 | given will be interpreted as pathname which is |
118 | subsequently transformed in a (real) package name via the Package | | 115 | subsequently transformed in a (real) package name via the Package |
119 | Database. | | 116 | Database. |
120 | That way, packages can be deleted by giving a filename | | 117 | That way, packages can be deleted by giving a filename |
121 | instead of the package-name. | | 118 | instead of the package-name. |
122 | .It Fl f | | 119 | .It Fl f |
123 | Force removal of the package, even if a dependency is recorded or the | | 120 | Force removal of the package, even if a dependency is recorded or the |
124 | deinstall script fails. | | 121 | deinstall script fails. |
125 | .It Fl ff | | 122 | .It Fl ff |
126 | Force removal of the package, even if the package is marked as a | | 123 | Force removal of the package, even if the package is marked as a |
127 | .Cm preserved | | 124 | .Cm preserved |
128 | package. | | 125 | package. |
129 | Note that this is a dangerous operation. | | 126 | Note that this is a dangerous operation. |
130 | See also the | | 127 | See also the |
131 | .Fl k | | 128 | .Fl k |
132 | option. | | 129 | option. |
133 | .It Fl K Ar pkg_dbdir | | 130 | .It Fl K Ar pkg_dbdir |
134 | Override the value of the | | 131 | Override the value of the |
135 | .Dv PKG_DBDIR | | 132 | .Dv PKG_DBDIR |
136 | configuration option with the value | | 133 | configuration option with the value |
137 | .Ar pkg_dbdir . | | 134 | .Ar pkg_dbdir . |
138 | .It Fl k | | 135 | .It Fl k |
139 | Silently skip all packages that are marked as | | 136 | Silently skip all packages that are marked as |
140 | .Cm preserved . | | 137 | .Cm preserved . |
141 | .It Fl N | | 138 | .It Fl N |
142 | Remove the package's registration and its entries from the package database, | | 139 | Remove the package's registration and its entries from the package database, |
143 | but leave the files installed. | | 140 | but leave the files installed. |
144 | Don't run any deinstall scripts or @unexec lines either. | | 141 | Don't run any deinstall scripts or |
| | | 142 | .Cm @unexec |
| | | 143 | lines either. |
145 | .It Fl n | | 144 | .It Fl n |
146 | Don't actually deinstall a package, just report the steps that | | 145 | Don't actually deinstall a package, just report the steps that |
147 | would be taken if it were. | | 146 | would be taken. |
148 | .It Fl O | | 147 | .It Fl O |
149 | Only delete the package's entries from the package database, do not | | 148 | Only delete the package's entries from the package database; do not |
150 | touch the package or its files itself. | | 149 | touch the package or its files itself. |
151 | .It Fl p Ar destdir | | 150 | .It Fl P Ar destdir |
152 | Prefix all file and directory names with | | 151 | Prefix all file and directory names with |
153 | .Ar destdir . | | 152 | .Ar destdir . |
154 | For packages without install scripts this has the same behavior as | | 153 | For packages without install scripts this has the same behavior as |
155 | using chroot. | | 154 | using chroot. |
156 | .It Fl p Ar prefix | | 155 | .It Fl p Ar prefix |
157 | Set | | 156 | Set |
158 | .Ar prefix | | 157 | .Ar prefix |
159 | as the directory in which to delete files from any installed packages | | 158 | as the directory in which to delete files from any installed packages |
160 | which do not explicitly set theirs. | | 159 | which do not explicitly set theirs. |
161 | For most packages, the prefix will | | 160 | For most packages, the prefix will |
162 | be set automatically to the installed location by | | 161 | be set automatically to the installed location by |
163 | .Xr pkg_add 1 . | | 162 | .Xr pkg_add 1 . |
164 | .It Fl R | | 163 | .It Fl R |
165 | Recursively remove all packages that were needed by the given packages | | 164 | Recursively remove all packages that were needed by the given packages |
166 | and that have no other dependencies left. | | 165 | and are no longer required, even if they were installed manually. |
167 | This option overrides the | | 166 | This option overrides the |
168 | .Fl A | | 167 | .Fl A |
169 | flag. | | 168 | flag. |
170 | .It Fl r | | 169 | .It Fl r |
171 | Recursively remove all packages that require one of the packages given. | | 170 | Recursively remove all packages that require one of the packages given. |
172 | .It Fl V | | 171 | .It Fl V |
173 | Print version number and exit. | | 172 | Print version number and exit. |
174 | .It Fl v | | 173 | .It Fl v |
175 | Turn on verbose output. | | 174 | Turn on verbose output. |
176 | .El | | 175 | .El |
177 | .Sh TECHNICAL DETAILS | | 176 | .Sh TECHNICAL DETAILS |
178 | .Nm | | 177 | .Nm |
179 | does pretty much what it says. | | 178 | does pretty much what it says. |
| @@ -188,28 +187,29 @@ will list those dependent packages and r | | | @@ -188,28 +187,29 @@ will list those dependent packages and r |
188 | .Fl f | | 187 | .Fl f |
189 | option is given). | | 188 | option is given). |
190 | .Pp | | 189 | .Pp |
191 | If a package has been marked as a | | 190 | If a package has been marked as a |
192 | .Cm preserved | | 191 | .Cm preserved |
193 | package, it will not be able to be deleted | | 192 | package, it will not be able to be deleted |
194 | (unless more than one occurrence of the | | 193 | (unless more than one occurrence of the |
195 | .Fl f | | 194 | .Fl f |
196 | option is given). | | 195 | option is given). |
197 | .Pp | | 196 | .Pp |
198 | If a filename is given instead of a package name, the package of which | | 197 | If a filename is given instead of a package name, the package of which |
199 | the given file belongs to can be deleted if the | | 198 | the given file belongs to can be deleted if the |
200 | .Fl F | | 199 | .Fl F |
201 | Flag is given. | | 200 | flag is given. |
202 | The filename needs to be absolute, see the output produced by the pkg_info | | 201 | The filename needs to be absolute, see the output produced by the |
| | | 202 | .Xr pkg_info 1 |
203 | .Fl aF | | 203 | .Fl aF |
204 | command. | | 204 | command. |
205 | .Pp | | 205 | .Pp |
206 | If a | | 206 | If a |
207 | .Cm deinstall | | 207 | .Cm deinstall |
208 | script exists for the package, it is executed before and after | | 208 | script exists for the package, it is executed before and after |
209 | any files are removed. | | 209 | any files are removed. |
210 | It is this script's responsibility to clean up any additional messy details | | 210 | It is this script's responsibility to clean up any additional messy details |
211 | around the package's installation, since all | | 211 | around the package's installation, since all |
212 | .Nm | | 212 | .Nm |
213 | knows how to do is delete the files created in the original distribution. | | 213 | knows how to do is delete the files created in the original distribution. |
214 | The | | 214 | The |
215 | .Ic deinstall | | 215 | .Ic deinstall |
| @@ -224,27 +224,27 @@ before removing the package from a view, | | | @@ -224,27 +224,27 @@ before removing the package from a view, |
224 | .Cm deinstall | | 224 | .Cm deinstall |
225 | .Aq Ar pkg-name | | 225 | .Aq Ar pkg-name |
226 | .Ar DEINSTALL | | 226 | .Ar DEINSTALL |
227 | .Ed | | 227 | .Ed |
228 | before deleting all files and as: | | 228 | before deleting all files and as: |
229 | .Bd -filled -offset indent -compact | | 229 | .Bd -filled -offset indent -compact |
230 | .Cm deinstall | | 230 | .Cm deinstall |
231 | .Aq Ar pkg-name | | 231 | .Aq Ar pkg-name |
232 | .Ar POST-DEINSTALL | | 232 | .Ar POST-DEINSTALL |
233 | .Ed | | 233 | .Ed |
234 | after deleting them. | | 234 | after deleting them. |
235 | Passing the keywords | | 235 | Passing the keywords |
236 | .Ar VIEW-DEINSTALL , | | 236 | .Ar VIEW-DEINSTALL , |
237 | .Ar DEINSTALL | | 237 | .Ar DEINSTALL , |
238 | and | | 238 | and |
239 | .Ar POST-DEINSTALL | | 239 | .Ar POST-DEINSTALL |
240 | lets you potentially write only one program/script that handles all | | 240 | lets you potentially write only one program/script that handles all |
241 | aspects of installation and deletion. | | 241 | aspects of installation and deletion. |
242 | .Pp | | 242 | .Pp |
243 | All scripts are called with the environment variable | | 243 | All scripts are called with the environment variable |
244 | .Ev PKG_PREFIX | | 244 | .Ev PKG_PREFIX |
245 | set to the installation prefix (see the | | 245 | set to the installation prefix (see the |
246 | .Fl p | | 246 | .Fl p |
247 | option above). | | 247 | option above). |
248 | This allows a package author to write a script | | 248 | This allows a package author to write a script |
249 | that reliably performs some action on the directory where the package | | 249 | that reliably performs some action on the directory where the package |
250 | is installed, even if the user might have changed it by specifying the | | 250 | is installed, even if the user might have changed it by specifying the |