| @@ -1,529 +1,516 @@ | | | @@ -1,529 +1,516 @@ |
1 | .\" $NetBSD: pkg_add.1,v 1.28.6.5 2008/05/30 13:37:36 wiz Exp $ | | 1 | .\" $NetBSD: pkg_add.1,v 1.28.6.6 2008/07/27 22:35:02 joerg 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 | .\" |
15 | .\" Jordan K. Hubbard | | 15 | .\" Jordan K. Hubbard |
16 | .\" | | 16 | .\" |
17 | .\" | | 17 | .\" |
18 | .\" @(#)pkg_add.1 | | 18 | .\" @(#)pkg_add.1 |
19 | .\" | | 19 | .\" |
20 | .Dd May 26, 2008 | | 20 | .Dd May 26, 2008 |
21 | .Dt PKG_ADD 1 | | 21 | .Dt PKG_ADD 1 |
22 | .Os | | 22 | .Os |
23 | .Sh NAME | | 23 | .Sh NAME |
24 | .Nm pkg_add | | 24 | .Nm pkg_add |
25 | .Nd a utility for installing and upgrading software package distributions | | 25 | .Nd a utility for installing and upgrading software package distributions |
26 | .Sh SYNOPSIS | | 26 | .Sh SYNOPSIS |
27 | .Nm | | 27 | .Nm |
28 | .Op Fl AfILnRuVv | | 28 | .Op Fl AfILnRuVv |
29 | .Op Fl K Ar pkg_dbdir | | 29 | .Op Fl K Ar pkg_dbdir |
30 | .Op Fl m Ar machine | | 30 | .Op Fl m Ar machine |
31 | .Op Fl p Ar prefix | | 31 | .Op Fl p Ar prefix |
32 | .Op Fl W Ar viewbase | | 32 | .Op Fl W Ar viewbase |
33 | .Op Fl w Ar view | | 33 | .Op Fl w Ar view |
34 | .Ar \fR[[ftp|http]://[\fIuser\fR[:\fIpassword]\fR@]\fIhost\fR[:\fIport\fR]][/\fIpath/\fR]pkg-name ... | | 34 | .Ar \fR[[ftp|http]://[\fIuser\fR[:\fIpassword]\fR@]\fIhost\fR[:\fIport\fR]][/\fIpath/\fR]pkg-name ... |
35 | .Sh DESCRIPTION | | 35 | .Sh DESCRIPTION |
36 | The | | 36 | The |
37 | .Nm | | 37 | .Nm |
38 | command is used to extract and upgrade packages that have been | | 38 | command is used to extract and upgrade packages that have been |
39 | previously created with the | | 39 | previously created with the |
40 | .Xr pkg_create 1 | | 40 | .Xr pkg_create 1 |
41 | command. | | 41 | command. |
42 | Packages are prepared collections of pre-built binaries, documentation, | | 42 | Packages are prepared collections of pre-built binaries, documentation, |
43 | configurations, installation instructions and/or other files. | | 43 | configurations, installation instructions and/or other files. |
44 | .Nm | | 44 | .Nm |
45 | can recursively install other packages that the current package | | 45 | can recursively install other packages that the current package |
46 | depends on or requires from both local disk and via FTP or HTTP. | | 46 | depends on or requires from both local disk and via FTP or HTTP. |
47 | .Sh WARNING | | 47 | .Sh WARNING |
48 | .Bf -emphasis | | 48 | .Bf -emphasis |
49 | Since the | | 49 | Since the |
50 | .Nm | | 50 | .Nm |
51 | command may execute scripts or programs contained within a package file, | | 51 | command may execute scripts or programs contained within a package file, |
52 | your system may be susceptible to | | 52 | your system may be susceptible to |
53 | .Dq Trojan horses | | 53 | .Dq Trojan horses |
54 | or other subtle | | 54 | or other subtle |
55 | attacks from miscreants who create dangerous package files. | | 55 | attacks from miscreants who create dangerous package files. |
56 | .Pp | | 56 | .Pp |
57 | You are advised to verify the competence and identity of those who | | 57 | You are advised to verify the competence and identity of those who |
58 | provide installable package files. | | 58 | provide installable package files. |
59 | For extra protection, use the digital signatures provided where possible | | 59 | For extra protection, use the digital signatures provided where possible |
60 | (see the | | 60 | (see the |
61 | .Xr pkg_install.conf 5 ) , | | 61 | .Xr pkg_install.conf 5 ) , |
62 | or, failing that, use | | 62 | or, failing that, use |
63 | .Xr tar 1 | | 63 | .Xr tar 1 |
64 | to extract the package file, and inspect its contents and scripts | | 64 | to extract the package file, and inspect its contents and scripts |
65 | to ensure it poses no danger to your system's integrity. | | 65 | to ensure it poses no danger to your system's integrity. |
66 | Pay particular attention to any | | 66 | Pay particular attention to any |
67 | .Pa +INSTALL | | 67 | .Pa +INSTALL |
68 | or | | 68 | or |
69 | .Pa +DEINSTALL | | 69 | .Pa +DEINSTALL |
70 | files, and inspect the | | 70 | files, and inspect the |
71 | .Pa +CONTENTS | | 71 | .Pa +CONTENTS |
72 | file for | | 72 | file for |
73 | .Cm @cwd , | | 73 | .Cm @cwd , |
74 | .Cm @mode | | 74 | .Cm @mode |
75 | (check for setuid), | | 75 | (check for setuid), |
76 | .Cm @dirrm , | | 76 | .Cm @dirrm , |
77 | .Cm @exec , | | 77 | .Cm @exec , |
78 | and | | 78 | and |
79 | .Cm @unexec | | 79 | .Cm @unexec |
80 | directives, and/or use the | | 80 | directives, and/or use the |
81 | .Xr pkg_info 1 | | 81 | .Xr pkg_info 1 |
82 | command to examine the package file. | | 82 | command to examine the package file. |
83 | .Ef | | 83 | .Ef |
84 | .Sh OPTIONS | | 84 | .Sh OPTIONS |
85 | The following command line arguments are supported: | | 85 | The following command line arguments are supported: |
86 | .Bl -tag -width indent | | 86 | .Bl -tag -width indent |
87 | .It Ar pkg-name [ ... ] | | 87 | .It Ar pkg-name [ ... ] |
88 | The named packages are installed. | | 88 | The named packages are installed. |
89 | .Ar pkg-name | | 89 | .Ar pkg-name |
90 | may be either a URL or a local pathname, | | 90 | may be either a URL or a local pathname, |
91 | a package name of "-" will cause | | 91 | a package name of "-" will cause |
92 | .Nm | | 92 | .Nm |
93 | to read from stdin. | | 93 | to read from stdin. |
94 | If the packages are not found in the current | | 94 | If the packages are not found in the current |
95 | working directory, | | 95 | working directory, |
96 | .Nm | | 96 | .Nm |
97 | will search them in each directory named by the | | 97 | will search them in each directory named by the |
98 | .Ev PKG_PATH | | 98 | .Ev PKG_PATH |
99 | environment variable. | | 99 | environment variable. |
100 | Any dependencies required by the installed package will be searched | | 100 | Any dependencies required by the installed package will be searched |
101 | in the same location that the original package was installed from. | | 101 | in the same location that the original package was installed from. |
102 | .It Fl A | | 102 | .It Fl A |
103 | Mark package as installed automatically, as dependency of another | | 103 | Mark package as installed automatically, as dependency of another |
104 | package. | | 104 | package. |
105 | You can use | | 105 | You can use |
106 | .Dl Ic pkg_admin set automatic=YES | | 106 | .Dl Ic pkg_admin set automatic=YES |
107 | to mark packages this way after installation, and | | 107 | to mark packages this way after installation, and |
108 | .Dl Ic pkg_admin unset automatic | | 108 | .Dl Ic pkg_admin unset automatic |
109 | to remove the mark. | | 109 | to remove the mark. |
110 | If you | | 110 | If you |
111 | .Nm | | 111 | .Nm |
112 | a package without specifying | | 112 | a package without specifying |
113 | .Fl A | | 113 | .Fl A |
114 | after it had already been automatically installed, the mark is | | 114 | after it had already been automatically installed, the mark is |
115 | removed. | | 115 | removed. |
116 | .It Fl f | | 116 | .It Fl f |
117 | Force installation to proceed even if prerequisite packages are not | | 117 | Force installation to proceed even if prerequisite packages are not |
118 | installed or the install script fails. | | 118 | installed or the install script fails. |
119 | Although | | 119 | Although |
120 | .Nm | | 120 | .Nm |
121 | will still try to find and auto-install missing prerequisite packages, | | 121 | will still try to find and auto-install missing prerequisite packages, |
122 | a failure to find one will not be fatal. | | 122 | a failure to find one will not be fatal. |
123 | This flag also overrides the fatal error when the operating system or | | 123 | This flag also overrides the fatal error when the operating system or |
124 | architecture the package was built on differ from that of the host. | | 124 | architecture the package was built on differ from that of the host. |
125 | .It Fl I | | 125 | .It Fl I |
126 | If an installation script exists for a given package, do not execute it. | | 126 | If an installation script exists for a given package, do not execute it. |
127 | .It Fl K Ar pkg_dbdir | | 127 | .It Fl K Ar pkg_dbdir |
128 | Set | | 128 | Set |
129 | .Ar pkg_dbdir | | 129 | .Ar pkg_dbdir |
130 | as the package database directory. | | 130 | as the package database directory. |
131 | If this option isn't specified, then the package database directory is | | 131 | If this option isn't specified, then the package database directory is |
132 | taken from the value of the environment variable | | 132 | taken from the value of the environment variable |
133 | .Ev PKG_DBDIR | | 133 | .Ev PKG_DBDIR |
134 | if it's set, otherwise it defaults to | | 134 | if it's set, otherwise it defaults to |
135 | .Pa /var/db/pkg . | | 135 | .Pa /var/db/pkg . |
136 | .It Fl L | | 136 | .It Fl L |
137 | Don't add the package to any views after installation. | | 137 | Don't add the package to any views after installation. |
138 | .It Fl m | | 138 | .It Fl m |
139 | Override the machine architecture returned by uname with | | 139 | Override the machine architecture returned by uname with |
140 | .Ar machine . | | 140 | .Ar machine . |
141 | .It Fl n | | 141 | .It Fl n |
142 | Don't actually install a package, just report the steps that | | 142 | Don't actually install a package, just report the steps that |
143 | would be taken if it was. | | 143 | would be taken if it was. |
144 | .It Fl p Ar prefix | | 144 | .It Fl p Ar prefix |
145 | Set | | 145 | Set |
146 | .Ar prefix | | 146 | .Ar prefix |
147 | as the directory in which to extract files from a package. | | 147 | as the directory in which to extract files from a package. |
148 | If a package has set its default directory, it will be overridden | | 148 | If a package has set its default directory, it will be overridden |
149 | by this flag. | | 149 | by this flag. |
150 | Note that only the first | | 150 | Note that only the first |
151 | .Cm @cwd | | 151 | .Cm @cwd |
152 | directive will be replaced, since | | 152 | directive will be replaced, since |
153 | .Nm | | 153 | .Nm |
154 | has no way of knowing which directory settings are relative and | | 154 | has no way of knowing which directory settings are relative and |
155 | which are absolute. | | 155 | which are absolute. |
156 | Only one directory transition is supported and the second one is expected to go | | 156 | Only one directory transition is supported and the second one is expected to go |
157 | into | | 157 | into |
158 | .Ar pkgdb . | | 158 | .Ar pkgdb . |
159 | .It Fl R | | 159 | .It Fl R |
160 | Do not record the installation of a package. | | 160 | Do not record the installation of a package. |
161 | This implies | | 161 | This implies |
162 | .Fl I . | | 162 | .Fl I . |
163 | This means that you cannot deinstall it later, so only use this option if | | 163 | This means that you cannot deinstall it later, so only use this option if |
164 | you know what you are doing! | | 164 | you know what you are doing! |
165 | .It Fl u | | 165 | .It Fl u |
166 | If the package that's being installed is already installed, either | | 166 | If the package that's being installed is already installed, either |
167 | in the same or a different version, an update is performed. | | 167 | in the same or a different version, an update is performed. |
168 | If this is specified twice, then any dependant packages that are | | 168 | If this is specified twice, then any dependant packages that are |
169 | too old will also be updated to fulfill the dependency. | | 169 | too old will also be updated to fulfill the dependency. |
170 | See below for a more detailed description of the process. | | 170 | See below for a more detailed description of the process. |
171 | .It Fl V | | 171 | .It Fl V |
172 | Print version number and exit. | | 172 | Print version number and exit. |
173 | .It Fl v | | 173 | .It Fl v |
174 | Turn on verbose output. | | 174 | Turn on verbose output. |
175 | .It Fl W Ar viewbase | | 175 | .It Fl W Ar viewbase |
176 | Set | | 176 | Set |
177 | .Ar viewbase | | 177 | .Ar viewbase |
178 | as the base directory for the managed views. | | 178 | as the base directory for the managed views. |
179 | The default | | 179 | The default |
180 | .Ar viewbase | | 180 | .Ar viewbase |
181 | directory is set by | | 181 | directory is set by |
182 | .Xr pkg_view 1 . | | 182 | .Xr pkg_view 1 . |
183 | This value also may be set from the | | 183 | This value also may be set from the |
184 | .Ev LOCALBASE | | 184 | .Ev LOCALBASE |
185 | environment variable. | | 185 | environment variable. |
186 | .It Fl w Ar view | | 186 | .It Fl w Ar view |
187 | Set the | | 187 | Set the |
188 | .Ar view | | 188 | .Ar view |
189 | to which packages should be added after installation. | | 189 | to which packages should be added after installation. |
190 | The default | | 190 | The default |
191 | .Ar view | | 191 | .Ar view |
192 | is set by | | 192 | is set by |
193 | .Xr pkg_view 1 . | | 193 | .Xr pkg_view 1 . |
194 | This value also may be set from the | | 194 | This value also may be set from the |
195 | .Ev PKG_VIEW | | 195 | .Ev PKG_VIEW |
196 | environment variable. | | 196 | environment variable. |
197 | .El | | 197 | .El |
198 | .Pp | | 198 | .Pp |
199 | One or more | | 199 | One or more |
200 | .Ar pkg-name | | 200 | .Ar pkg-name |
201 | arguments may be specified, each being either a file containing the | | 201 | arguments may be specified, each being either a file containing the |
202 | package (these usually ending with the | | 202 | package (these usually ending with the |
203 | .Dq .tgz | | 203 | .Dq .tgz |
204 | suffix) or a | | 204 | suffix) or a |
205 | URL pointing at a file available on an ftp or web site. | | 205 | URL pointing at a file available on an ftp or web site. |
206 | Thus you may extract files directly from their anonymous ftp or WWW | | 206 | Thus you may extract files directly from their anonymous ftp or WWW |
207 | locations (e.g., | | 207 | locations (e.g., |
208 | .Nm | | 208 | .Nm |
209 | ftp://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/i386/3.1_2007Q2/shells/bash-3.2.9.tgz | | 209 | ftp://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/i386/3.1_2007Q2/shells/bash-3.2.9.tgz |
210 | or | | 210 | or |
211 | .Nm | | 211 | .Nm |
212 | http://www.example.org/packages/screen-4.0.tbz). | | 212 | http://www.example.org/packages/screen-4.0.tbz). |
213 | Note: For ftp transfers, if you wish to use | | 213 | Note: For ftp transfers, if you wish to use |
214 | .Bf -emphasis | | 214 | .Bf -emphasis |
215 | passive mode | | 215 | passive mode |
216 | .Ef | | 216 | .Ef |
217 | ftp in such transfers, set the variable | | 217 | ftp in such transfers, set the variable |
218 | .Bf -emphasis | | 218 | .Bf -emphasis |
219 | FTP_PASSIVE_MODE | | 219 | FTP_PASSIVE_MODE |
220 | .Ef | | 220 | .Ef |
221 | to some value in your environment. | | 221 | to some value in your environment. |
222 | Otherwise, the more standard ACTIVE mode may be used. | | 222 | Otherwise, the more standard ACTIVE mode may be used. |
223 | If | | 223 | If |
224 | .Nm | | 224 | .Nm |
225 | consistently fails to fetch a package from a site known to work, | | 225 | consistently fails to fetch a package from a site known to work, |
226 | it may be because you have a firewall that demands the usage of | | 226 | it may be because you have a firewall that demands the usage of |
227 | .Bf -emphasis | | 227 | .Bf -emphasis |
228 | passive mode | | 228 | passive mode |
229 | .Ef | | 229 | .Ef |
230 | ftp. | | 230 | ftp. |
231 | .Sh TECHNICAL DETAILS | | 231 | .Sh TECHNICAL DETAILS |
232 | .Nm | | 232 | .Nm |
233 | extracts each package's meta data (including the | | 233 | extracts each package's meta data (including the |
234 | .Dq packing list ) | | 234 | .Dq packing list ) |
235 | to memory and then runs through the following sequence to fully extract | | 235 | to memory and then runs through the following sequence to fully extract |
236 | the contents of the package: | | 236 | the contents of the package: |
237 | .Bl -enum -offset indent | | 237 | .Bl -enum -offset indent |
238 | .It | | 238 | .It |
239 | A check is made to determine if the package or another version of it | | 239 | A check is made to determine if the package or another version of it |
240 | is already recorded as installed. | | 240 | is already recorded as installed. |
241 | If it is, | | 241 | If it is, |
242 | installation is terminated if the | | 242 | installation is terminated if the |
243 | .Fl u | | 243 | .Fl u |
244 | option is not given. | | 244 | option is not given. |
245 | .Pp | | 245 | .Pp |
246 | If the | | 246 | If the |
247 | .Fl u | | 247 | .Fl u |
248 | option is given, it's assumed the package should be replaced by the | | 248 | option is given, it's assumed the package should be replaced by the |
249 | new version instead. | | 249 | new version instead. |
250 | Before doing so, all packages that depend on the | | 250 | Before doing so, all packages that depend on the |
251 | pkg being upgraded are checked if they also work with the new version. | | 251 | pkg being upgraded are checked if they also work with the new version. |
252 | If that test is successful, replacing is prepared by moving an existing | | 252 | If that test is successful, replacing is prepared by moving an existing |
253 | .Pa +REQUIRED_BY | | 253 | .Pa +REQUIRED_BY |
254 | file aside (if it exists), and running | | 254 | file aside (if it exists), and running |
255 | .Xr pkg_delete 1 | | 255 | .Xr pkg_delete 1 |
256 | on the installed package. | | 256 | on the installed package. |
257 | Installation then proceeds as if the package | | 257 | Installation then proceeds as if the package |
258 | was not installed, and restores the | | 258 | was not installed, and restores the |
259 | .Pa +REQUIRED_BY | | 259 | .Pa +REQUIRED_BY |
260 | file afterwards. | | 260 | file afterwards. |
261 | .It | | 261 | .It |
262 | The package build information is extracted from the | | 262 | The package build information is extracted from the |
263 | .Pa +BUILD_INFO | | 263 | .Pa +BUILD_INFO |
264 | file and compared against the result of | | 264 | file and compared against the result of |
265 | .Xr uname 3 . | | 265 | .Xr uname 3 . |
266 | If the operating system or architecture of the package differ from | | 266 | If the operating system or architecture of the package differ from |
267 | that of the host, installation is aborted. | | 267 | that of the host, installation is aborted. |
268 | This behavior is overridable with the | | 268 | This behavior is overridable with the |
269 | .Fl f | | 269 | .Fl f |
270 | flag. | | 270 | flag. |
271 | .It | | 271 | .It |
272 | The package build information from | | 272 | The package build information from |
273 | .Pa +BUILD_INFO | | 273 | .Pa +BUILD_INFO |
274 | is then checked for | | 274 | is then checked for |
275 | .Ev USE_ABI_DEPENDS=NO | | 275 | .Ev USE_ABI_DEPENDS=NO |
276 | (or | | 276 | (or |
277 | .Ev IGNORE_RECOMMENDED ) . | | 277 | .Ev IGNORE_RECOMMENDED ) . |
278 | If the package was built with ABI dependency recommendations ignored, | | 278 | If the package was built with ABI dependency recommendations ignored, |
279 | a warning will be issued. | | 279 | a warning will be issued. |
280 | .It | | 280 | .It |
281 | A check is made to determine if the package conflicts (from | | 281 | A check is made to determine if the package conflicts (from |
282 | .Cm @pkgcfl | | 282 | .Cm @pkgcfl |
283 | directives, see | | 283 | directives, see |
284 | .Xr pkg_create 1 ) | | 284 | .Xr pkg_create 1 ) |
285 | with an already recorded as installed package or if an installed package | | 285 | with an already recorded as installed package or if an installed package |
286 | conflicts with the package. | | 286 | conflicts with the package. |
287 | If it is, installation is terminated. | | 287 | If it is, installation is terminated. |
288 | .It | | 288 | .It |
289 | The file list of the package is compared to the file lists of the | | 289 | The file list of the package is compared to the file lists of the |
290 | installed packeges. | | 290 | installed packeges. |
291 | If there is any overlap, the installation is terminated. | | 291 | If there is any overlap, the installation is terminated. |
292 | .It | | 292 | .It |
293 | All package dependencies (from | | 293 | All package dependencies (from |
294 | .Cm @pkgdep | | 294 | .Cm @pkgdep |
295 | directives, see | | 295 | directives, see |
296 | .Xr pkg_create 1 ) | | 296 | .Xr pkg_create 1 ) |
297 | are read from the packing list. | | 297 | are read from the packing list. |
298 | If any of these required packages are not currently installed, | | 298 | If any of these required packages are not currently installed, |
299 | an attempt is made to find and install it; | | 299 | an attempt is made to find and install it; |
300 | if the missing package cannot be found or installed, | | 300 | if the missing package cannot be found or installed, |
301 | the installation is terminated. | | 301 | the installation is terminated. |
302 | If the | | 302 | If the |
303 | .Fl u | | 303 | .Fl u |
304 | option was specified twice, any required packages that are installed, | | 304 | option was specified twice, any required packages that are installed, |
305 | but which have a version number that is considered to be too old, | | 305 | but which have a version number that is considered to be too old, |
306 | are also updated. | | 306 | are also updated. |
307 | The dependant packages are found according to the normal | | 307 | The dependant packages are found according to the normal |
308 | .Ev PKG_PATH | | 308 | .Ev PKG_PATH |
309 | rules. | | 309 | rules. |
310 | .It | | 310 | .It |
311 | If the package contains an | | 311 | If the package contains an |
312 | .Ar install | | 312 | .Ar install |
313 | script, it is executed with the following arguments: | | 313 | script, it is executed with the following arguments: |
314 | .Bl -tag -width indentindent | | 314 | .Bl -tag -width indentindent |
315 | .It Ar pkg-name | | 315 | .It Ar pkg-name |
316 | The name of the package being installed. | | 316 | The name of the package being installed. |
317 | .It Cm PRE-INSTALL | | 317 | .It Cm PRE-INSTALL |
318 | Keyword denoting that the script is to perform any actions needed before | | 318 | Keyword denoting that the script is to perform any actions needed before |
319 | the package is installed. | | 319 | the package is installed. |
320 | .El | | 320 | .El |
321 | .Pp | | 321 | .Pp |
322 | If the | | 322 | If the |
323 | .Ar install | | 323 | .Ar install |
324 | script exits with a non-zero status code, the installation is terminated. | | 324 | script exits with a non-zero status code, the installation is terminated. |
325 | .It | | 325 | .It |
326 | The files from the file list are extracted to the choosen prefix. | | 326 | The files from the file list are extracted to the choosen prefix. |
327 | .It | | 327 | .It |
328 | If an | | 328 | If an |
329 | .Ar install | | 329 | .Ar install |
330 | script exists for the package, it is executed with the following arguments: | | 330 | script exists for the package, it is executed with the following arguments: |
331 | .Bl -tag -width indentindent | | 331 | .Bl -tag -width indentindent |
332 | .It Ar pkg_name | | 332 | .It Ar pkg_name |
333 | The name of the package being installed. | | 333 | The name of the package being installed. |
334 | .It Cm POST-INSTALL | | 334 | .It Cm POST-INSTALL |
335 | Keyword denoting that the script is to perform any actions needed | | 335 | Keyword denoting that the script is to perform any actions needed |
336 | after the package has been installed. | | 336 | after the package has been installed. |
337 | .El | | 337 | .El |
338 | .It | | 338 | .It |
339 | After installation is complete, a copy of the packing list, | | 339 | After installation is complete, a copy of the packing list, |
340 | .Ar deinstall | | 340 | .Ar deinstall |
341 | script, description, and display files are copied into | | 341 | script, description, and display files are copied into |
342 | .Pa /var/db/pkg/\*[Lt]pkg-name\*[Gt] | | 342 | .Pa /var/db/pkg/\*[Lt]pkg-name\*[Gt] |
343 | for subsequent possible use by | | 343 | for subsequent possible use by |
344 | .Xr pkg_delete 1 . | | 344 | .Xr pkg_delete 1 . |
345 | Any package dependencies are recorded in the other packages' | | 345 | Any package dependencies are recorded in the other packages' |
346 | .Pa /var/db/pkg/\*[Lt]other-pkg\*[Gt]/+REQUIRED_BY | | 346 | .Pa /var/db/pkg/\*[Lt]other-pkg\*[Gt]/+REQUIRED_BY |
347 | file | | 347 | file |
348 | (if an alternate package database directory is specified, then it | | 348 | (if an alternate package database directory is specified, then it |
349 | overrides the | | 349 | overrides the |
350 | .Pa /var/db/pkg | | 350 | .Pa /var/db/pkg |
351 | path shown above). | | 351 | path shown above). |
352 | .It | | 352 | .It |
353 | If the package is a depoted package, then add it to the default view. | | 353 | If the package is a depoted package, then add it to the default view. |
354 | .It | | 354 | .It |
355 | Finally, if we were upgrading a package, any | | 355 | Finally, if we were upgrading a package, any |
356 | .Pa +REQUIRED_BY | | 356 | .Pa +REQUIRED_BY |
357 | file that was moved aside before upgrading was started is now moved | | 357 | file that was moved aside before upgrading was started is now moved |
358 | back into place. | | 358 | back into place. |
359 | .El | | 359 | .El |
360 | .Pp | | 360 | .Pp |
361 | The | | 361 | The |
362 | .Ar install | | 362 | .Ar install |
363 | script is called with the environment variable | | 363 | script is called with the environment variable |
364 | .Ev PKG_PREFIX | | 364 | .Ev PKG_PREFIX |
365 | set to the installation prefix (see the | | 365 | set to the installation prefix (see the |
366 | .Fl p | | 366 | .Fl p |
367 | option above). | | 367 | option above). |
368 | This allows a package author to write a script | | 368 | This allows a package author to write a script |
369 | that reliably performs some action on the directory where the package | | 369 | that reliably performs some action on the directory where the package |
370 | is installed, even if the user might change it with the | | 370 | is installed, even if the user might change it with the |
371 | .Fl p | | 371 | .Fl p |
372 | flag to | | 372 | flag to |
373 | .Cm pkg_add . | | 373 | .Cm pkg_add . |
374 | The scripts are also called with the | | 374 | The scripts are also called with the |
375 | .Ev PKG_METADATA_DIR | | 375 | .Ev PKG_METADATA_DIR |
376 | environment variable set to the location of the | | 376 | environment variable set to the location of the |
377 | .Pa +* | | 377 | .Pa +* |
378 | meta-data files, and with the | | 378 | meta-data files, and with the |
379 | .Ev PKG_REFCOUNT_DBDIR | | 379 | .Ev PKG_REFCOUNT_DBDIR |
380 | environment variable set to the location of the package reference counts | | 380 | environment variable set to the location of the package reference counts |
381 | database directory. | | 381 | database directory. |
382 | .Sh ENVIRONMENT | | 382 | .Sh ENVIRONMENT |
383 | .Bl -tag -width PKG_TMPDIR | | 383 | .Bl -tag -width PKG_TMPDIR |
384 | .It Ev LOCALBASE | | 384 | .It Ev LOCALBASE |
385 | This is the location of the | | 385 | This is the location of the |
386 | .Ar viewbase | | 386 | .Ar viewbase |
387 | directory in which all the views are managed. | | 387 | directory in which all the views are managed. |
388 | The default | | 388 | The default |
389 | .Ar viewbase | | 389 | .Ar viewbase |
390 | directory is | | 390 | directory is |
391 | .Pa /usr/pkg . | | 391 | .Pa /usr/pkg . |
392 | .It Ev PKG_DBDIR | | 392 | .It Ev PKG_DBDIR |
393 | If the | | 393 | If the |
394 | .Fl K | | 394 | .Fl K |
395 | flag isn't given, then | | 395 | flag isn't given, then |
396 | .Ev PKG_DBDIR | | 396 | .Ev PKG_DBDIR |
397 | is the location of the package database directory. | | 397 | is the location of the package database directory. |
398 | The default package database directory is | | 398 | The default package database directory is |
399 | .Pa /var/db/pkg . | | 399 | .Pa /var/db/pkg . |
400 | .It Ev PKG_PATH | | 400 | .It Ev PKG_PATH |
401 | The value of the | | 401 | The value of the |
402 | .Ev PKG_PATH | | 402 | .Ev PKG_PATH |
403 | is used if a given package can't be found, it's usually set to | | 403 | is used if a given package can't be found, it's usually set to |
404 | .Pa /usr/pkgsrc/packages/All . | | 404 | .Pa /usr/pkgsrc/packages/All . |
405 | The environment variable | | 405 | The environment variable |
406 | should be a series of entries separated by semicolons. | | 406 | should be a series of entries separated by semicolons. |
407 | Each entry consists of a directory name or URL. | | 407 | Each entry consists of a directory name or URL. |
408 | The current directory may be indicated implicitly by an empty directory | | 408 | The current directory may be indicated implicitly by an empty directory |
409 | name, or explicitly by a single period. | | 409 | name, or explicitly by a single period. |
410 | FTP URLs may not end with a slash. | | 410 | FTP URLs may not end with a slash. |
411 | .It Ev PKG_REFCOUNT_DBDIR | | 411 | .It Ev PKG_REFCOUNT_DBDIR |
412 | Location of the package reference counts database directory. | | 412 | Location of the package reference counts database directory. |
413 | The default location is the path to the package database directory with | | 413 | The default location is the path to the package database directory with |
414 | .Dq .refcount | | 414 | .Dq .refcount |
415 | appended to the path, e.g. | | 415 | appended to the path, e.g. |
416 | .Pa /var/db/pkg.refcount . | | 416 | .Pa /var/db/pkg.refcount . |
417 | .It Ev PKG_VIEW | | 417 | .It Ev PKG_VIEW |
418 | The default view can be specified in the | | 418 | The default view can be specified in the |
419 | .Ev PKG_VIEW | | 419 | .Ev PKG_VIEW |
420 | environment variable. | | 420 | environment variable. |
421 | .El | | 421 | .El |
422 | .Sh EXAMPLES | | 422 | .Sh EXAMPLES |
423 | In all cases, | | 423 | In all cases, |
424 | .Nm | | 424 | .Nm |
425 | will try to install binary packages listed in dependencies list. | | 425 | will try to install binary packages listed in dependencies list. |
426 | .Pp | | 426 | .Pp |
427 | You can specify a compiled binary package explicitly on the command line. | | 427 | You can specify a compiled binary package explicitly on the command line. |
428 | .Bd -literal | | 428 | .Bd -literal |
429 | # pkg_add /usr/pkgsrc/packages/All/tcsh-6.14.00.tgz | | 429 | # pkg_add /usr/pkgsrc/packages/All/tcsh-6.14.00.tgz |
430 | .Ed | | 430 | .Ed |
431 | .Pp | | 431 | .Pp |
432 | If you omit the version number, | | 432 | If you omit the version number, |
433 | .Nm | | 433 | .Nm |
434 | will install the latest version available. | | 434 | will install the latest version available. |
435 | With | | 435 | With |
436 | .Fl v , | | 436 | .Fl v , |
437 | .Nm | | 437 | .Nm |
438 | emits more messages to terminal. | | 438 | emits more messages to terminal. |
439 | .Bd -literal | | 439 | .Bd -literal |
440 | # pkg_add -v /usr/pkgsrc/packages/All/unzip | | 440 | # pkg_add -v /usr/pkgsrc/packages/All/unzip |
441 | .Ed | | 441 | .Ed |
442 | .Pp | | 442 | .Pp |
443 | You can grab a compiled binary package from remote location by specifying | | 443 | You can grab a compiled binary package from remote location by specifying |
444 | a URL. | | 444 | a URL. |
445 | The URL can be put into an environment variable, | | 445 | The URL can be put into an environment variable, |
446 | .Ev PKG_PATH . | | 446 | .Ev PKG_PATH . |
447 | .Bd -literal | | 447 | .Bd -literal |
448 | # pkg_add -v ftp://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/i386/3.1_2007Q2/All/firefox-2.0.0.4.tgz | | 448 | # pkg_add -v ftp://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/i386/3.1_2007Q2/All/firefox-2.0.0.4.tgz |
449 | | | 449 | |
450 | # export PKG_PATH=ftp://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/i386/3.1_2007Q2/All | | 450 | # export PKG_PATH=ftp://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/i386/3.1_2007Q2/All |
451 | # pkg_add -v firefox | | 451 | # pkg_add -v firefox |
452 | .Ed | | 452 | .Ed |
453 | .Pp | | 453 | .Pp |
454 | Over time, as problems are found in packages, they will be moved | | 454 | Over time, as problems are found in packages, they will be moved |
455 | from the | | 455 | from the |
456 | .Pa All | | 456 | .Pa All |
457 | subdirectory into the | | 457 | subdirectory into the |
458 | .Pa vulnerable | | 458 | .Pa vulnerable |
459 | subdirectory. | | 459 | subdirectory. |
460 | If you want to accept vulnerable packages by default | | 460 | If you want to accept vulnerable packages by default |
461 | (and know what you are doing), | | 461 | (and know what you are doing), |
462 | you can add the | | 462 | you can add the |
463 | .Pa vulnerable | | 463 | .Pa vulnerable |
464 | directory to your | | 464 | directory to your |
465 | .Ev PKG_PATH | | 465 | .Ev PKG_PATH |
466 | like this: | | 466 | like this: |
467 | .Bd -literal | | 467 | .Bd -literal |
468 | # export PKG_PATH="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/i386/3.1_2007Q2/All/;ftp://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/i386/3.1_2007Q2/vulnerable/" | | 468 | # export PKG_PATH="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/i386/3.1_2007Q2/All/;ftp://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/i386/3.1_2007Q2/vulnerable/" |
469 | .Ed | | 469 | .Ed |
470 | .Pp | | 470 | .Pp |
471 | (The quotes are needed because semicolon | | 471 | (The quotes are needed because semicolon |
472 | .Pq Sq \&; | | 472 | .Pq Sq \&; |
473 | is a shell meta-character.) | | 473 | is a shell meta-character.) |
474 | If you do this, consider installing and using the | | 474 | If you do this, consider installing and using the |
475 | .Pa security/audit-packages | | 475 | .Pa security/audit-packages |
476 | package and running it after every | | 476 | package and running it after every |
477 | .Nm . | | 477 | .Nm . |
478 | .Sh CONFIGURATION VARIABLES | | 478 | .Sh CONFIGURATION VARIABLES |
479 | The following variables change the behaviour of | | 479 | The following variables change the behaviour of |
480 | .Nm | | 480 | .Nm |
481 | and are described in | | 481 | and are described in |
482 | .Xr pkg_install.conf 5 : | | 482 | .Xr pkg_install.conf 5 : |
483 | .Bl -tag -width CERTIFICATE_ANCHOR_PKGS | | 483 | .Bl -tag -width CERTIFICATE_ANCHOR_PKGS |
484 | .It Ev CERTIFICATE_ANCHOR_PKGS | | 484 | .It Ev CERTIFICATE_ANCHOR_PKGS |
485 | .It Ev CERTIFICATE_CHAIN | | 485 | .It Ev CERTIFICATE_CHAIN |
486 | .It Ev VERIFIED_INSTALLATION | | 486 | .It Ev VERIFIED_INSTALLATION |
487 | .El | | 487 | .El |
488 | .Sh SEE ALSO | | 488 | .Sh SEE ALSO |
489 | .Xr pkg_admin 1 , | | 489 | .Xr pkg_admin 1 , |
490 | .Xr pkg_create 1 , | | 490 | .Xr pkg_create 1 , |
491 | .Xr pkg_delete 1 , | | 491 | .Xr pkg_delete 1 , |
492 | .Xr pkg_info 1 , | | 492 | .Xr pkg_info 1 , |
493 | .Xr tar 1 , | | 493 | .Xr tar 1 , |
494 | .Xr mktemp 3 , | | 494 | .Xr mktemp 3 , |
495 | .Xr sysconf 3 , | | 495 | .Xr sysconf 3 , |
496 | .Xr pkg_install.conf 5 , | | 496 | .Xr pkg_install.conf 5 , |
497 | .Xr pkgsrc 7 | | 497 | .Xr pkgsrc 7 |
498 | .Sh AUTHORS | | 498 | .Sh AUTHORS |
499 | .Bl -tag -width indent -compact | | 499 | .Bl -tag -width indent -compact |
500 | .It "Jordan Hubbard" | | 500 | .It "Jordan Hubbard" |
501 | Initial work and ongoing development. | | 501 | Initial work and ongoing development. |
502 | .It "John Kohl" | | 502 | .It "John Kohl" |
503 | .Nx | | 503 | .Nx |
504 | refinements. | | 504 | refinements. |
505 | .It "Hubert Feyrer" | | 505 | .It "Hubert Feyrer" |
506 | .Nx | | 506 | .Nx |
507 | wildcard dependency processing, pkgdb, upgrading, etc. | | 507 | wildcard dependency processing, pkgdb, upgrading, etc. |
508 | .It Thomas Klausner | | 508 | .It Thomas Klausner |
509 | HTTP support. | | 509 | HTTP support. |
510 | .It Joerg Sonnenberger | | 510 | .It Joerg Sonnenberger |
511 | Rewrote most of the code base to work without external commands. | | 511 | Rewrote most of the code base to work without external commands. |
512 | .El | | 512 | .El |
513 | .Sh BUGS | | 513 | .Sh BUGS |
514 | Hard links between files in a distribution are only preserved if either | | | |
515 | (1) the staging area is on the same file system as the target directory of | | | |
516 | all the links to the file, or (2) all the links to the file are bracketed by | | | |
517 | .Cm @cwd | | | |
518 | directives in the contents file, | | | |
519 | .Em and | | | |
520 | and the link names are extracted with a single | | | |
521 | .Cm tar | | | |
522 | command (not split between | | | |
523 | invocations due to exec argument-space limitations--this depends on the | | | |
524 | value returned by | | | |
525 | .Fn sysconf _SC_ARG_MAX ) . | | | |
526 | .Pp | | | |
527 | Package upgrading needs a lot more work to be really universal. | | 514 | Package upgrading needs a lot more work to be really universal. |
528 | .Pp | | 515 | .Pp |
529 | Sure to be others. | | 516 | Sure to be others. |