1pkgtrans(1) User Commands pkgtrans(1)
2
3
4
6 pkgtrans - translate package format
7
9 pkgtrans [-inosg] [-k keystore] [-a alias] [-P passwd] device1 device2
10 [pkginst]...
11
12
14 The pkgtrans utility translates an installable package from one format
15 to another. It translates:
16
17 o a file system format to a datastream
18
19 o a file system format to a signed datastream
20
21 o a datastream to a file system format
22
23 o one file system format to another file system format
24
26 The options and arguments for this command are:
27
28 -a alias Use public key certificate associated with friendlyName
29 alias, and the corresponding private key. See KEYSTORE
30 LOCATIONS and KEYSTORE AND CERTIFICATE FORMATS in
31 pkgadd(1M) for more information.
32
33
34 -g Sign resulting datastream.
35
36
37 -i Copies only the pkginfo(4) and pkgmap(4) files.
38
39
40 -k keystore Use keystore to retrieve private key used to generate
41 signature. If it not specified, default locations are
42 searched to find the specified private key specified by
43 -a. If no alias is given, and multiple keys exist in the
44 key store, pkgtrans will abort. See KEYSTORE LOCATIONS
45 and KEYSTORE AND CERTIFICATE FORMATS in pkgadd(1M) for
46 more information on search locations and formats.
47
48 When running as a user other than root, the default base
49 directory for certificate searching is ~/.pkg/security,
50 where ~ is the home directory of the user invoking pkg‐
51 trans.
52
53
54 -n Creates a new instance of the package on the destination
55 device if any instance of this package already exists,
56 up to the number specified by the MAXINST variable in
57 the pkginfo(4) file.
58
59
60 -o Overwrites the same instance on the destination device.
61 Package instance will be overwritten if it already
62 exists.
63
64
65 -P passwd Supply password used to decrypt the keystore. See PASS
66 PHRASE ARGUMENTS in pkgadd(1M) for details on the syntax
67 of the argument to this option.
68
69
70 -s Indicates that the package should be written to device2
71 as a datastream rather than as a file system. The
72 default behavior is to write a file system format on
73 devices that support both formats.
74
75
77 device1 Indicates the source device. The package or packages on this
78 device will be translated and placed on device2. See DEVICE
79 SPECIFIERS, below.
80
81
82 device2 Indicates the destination device. Translated packages will
83 be placed on this device. See DEVICE SPECIFIERS, below.
84
85
86 pkginst Specifies which package instance or instances on device1
87 should be translated. The token all may be used to indicate
88 all packages. pkginst.* can be used to indicate all
89 instances of a package. If no packages are defined, a prompt
90 shows all packages on the device and asks which to trans‐
91 late.
92
93 The asterisk character (*) is a special character to some
94 shells and may need to be escaped. In the C-Shell, the *
95 must be surrounded by single quotes (') or preceded by a
96 backslash (\).
97
98
100 Packaging tools, including pkgtrans, pkgadd(1M), and pkgchk(1M), have
101 options for specifying a package location by specifying the device on
102 which it resides. Listed below are the device types that a package can
103 be stored to and retrieved from. Note that source and destination
104 devices cannot be the same.
105
106 device Packages can be stored to a character or block device
107 by specifying the device identifier as the device. Com‐
108 mon examples of this device type are /dev/rmt/0 for a
109 removable magnetic tape and /floppy/floppy0 for the
110 first floppy disk on the system. pkgtrans can also pro‐
111 duce regular file system files in a stream format,
112 which is suitable for storage on a character device,
113 web server, or as input to pkgadd(1M).
114
115
116 device alias Devices that have been specified in /etc/device.tab are
117 eligible for being the recipient or source of a pack‐
118 age. Common examples of this type of device specifica‐
119 tion are spool (the default package device location)
120 and disk1. These names correspond to devices specified
121 in /etc/device.tab
122
123
124 directory Packages can be stored onto a directory by specifying
125 an absolute path to a file system directory. The pack‐
126 age contents reside in a directory within the specified
127 directory. The package directory name must be identical
128 to its PKG specification in the pkginfo(4) file. An
129 example device specification of this type is
130 /export/packages.
131
132
134 Example 1 Translating All Packages on the Floppy Disk
135
136
137 The following example translates all packages on the floppy drive
138 /dev/diskette and places the translations on /tmp:
139
140
141 example% pkgtrans /dev/diskette /tmp all
142
143
144
145 Example 2 Translating Packages on /tmp
146
147
148 The following example translates packages pkg1 and pkg2 on /tmp and
149 places their translations (that is, a datastream) on the 9track1 output
150 device:
151
152
153 example% pkgtrans /tmp 9track1 pkg1 pkg2
154
155
156
157 Example 3 Translating Packages on /tmp
158
159
160 The following example translates pkg1 and pkg2 on /tmp and places them
161 on the diskette in a datastream format:
162
163
164 example% pkgtrans -s /tmp /dev/diskette pkg1 pkg2
165
166
167
168 Example 4 Creating a Signed Package
169
170
171 The following example creates a signed package from pkg1 and pkg2, and
172 reads the password from the $PASS environment variable:
173
174
175 example% pkgtrans -sg -k /tmp/keystore.p12 -a foo \
176 -p env:PASS /tmp /tmp/signedpkg pkg1 pkg2
177
178
179
180 Example 5 Translating a Package Datastream
181
182
183 The following example translates a package datastream into a file sys‐
184 tem format package:
185
186
187 example% pkgtrans /tmp/pkg1.pkg ~/tmp pkg1
188
189
190
192 The MAXINST variable is set in the pkginfo(4) file and declares the
193 maximum number of package instances.
194
196 0 Successful completion.
197
198
199 >0 An error occurred.
200
201
203 See attributes(5) for descriptions of the following attributes:
204
205
206
207
208 ┌─────────────────────────────┬─────────────────────────────┐
209 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
210 ├─────────────────────────────┼─────────────────────────────┤
211 │Availability │SUNWpkgcmdsu │
212 ├─────────────────────────────┼─────────────────────────────┤
213 │Interface Stability │See below. │
214 └─────────────────────────────┴─────────────────────────────┘
215
216
217 The command-line syntax is Evolving. The digitally-signed stream pack‐
218 age is Evolving.
219
221 pkginfo(1), pkgmk(1), pkgparam(1), pkgproto(1), installf(1M),
222 pkgadd(1M), pkgask(1M), pkgrm(1M), removef(1M), pkginfo(4), pkgmap(4),
223 attributes(5), largefile(5)
224
225
226 Application Packaging Developer's Guide
227
229 By default, pkgtrans does not translate any instance of a package if
230 any instance of that package already exists on the destination device.
231 Using the -n option creates a new instance if an instance of this pack‐
232 age already exists. Using the -o option overwrites an instance of this
233 package if it already exists. Neither of these options are useful if
234 the destination device is a datastream.
235
236
237 Package commands are largefile(5)-aware. They handle files larger than
238 2 GB in the same way they handle smaller files. In their current imple‐
239 mentations, pkgadd(1M), pkgtrans and other package commands can process
240 a datastream of up to 4 GB.
241
242
243
244SunOS 5.11 30 Oct 2007 pkgtrans(1)