![]() | Translating Package Formats |
You can use the pkgtrans command to translate an installable package from one format to another. pkgtrans performs the following translations.
A file system format to a datastream.
A datastream to a file system format.
One file system format to another file system format.
The pkgtrans command uses the following syntax.
/usr/bin/pkgtrans [-inos= device1 device2 [pkginst]
Table 73 describes the pktrans options.
Option | Description |
---|---|
-i | Copy only the pkginfo(4) and pkgmap(4) files. |
-n | Create a new instance of the package on the destination device if any instance of this package already exists, up to the number specified by the MAXINST variable in the pkginfo(4) file. |
-o | Overwrite the same instance on the destination device if it already exists. |
-s | Write the package to device2 as a datastream instead of as a file system. The default behavior is to write a file system format on devices that support both formats. |
The device1 operand specifies the source device. The package or packages on this device are translated and placed on device2.device2 specifies the destination device. Translated packages are placed on this device. pkginst specifies which package instance or instances on device1 should be translated. You can use the token all to indicate all packages. You can use pkginst.* to indicate all instances of a package. If no packages are defined, a prompt shows all packages on the device and asks which to translate.
The following example creates a file named raw-pkg-file from the packages contained in /var/spool/pkg.
castle# pkgtrans -s /var/spool/pkg /tmp/raw-pkg-file The following packages are available: 1 SUNWab2r AnswerBook2 Documentation Server (sparc) 3.0,REV=2000.0804 2 SUNWab2s AnswerBook2 Documentation Server (sparc) 3.0,REV=2000.0804 3 SUNWab2u AnswerBook2 Documentation Server (sparc) 3.0,REV=2000.0804 Select package(s) you wish to process (or 'all' to process all packages). (default: all) [?,??,q]: all Transferring <SUNWab2r> package instance Transferring <SUNWab2s> package instance Transferring <SUNWab2u> package instance castle#
You are prompted to ask which packages you want to transfer. You can use the all token to specify all packages.
You can also use the pkgtrans command to write the packages to a raw tape device. The following example writes the packages to the /dev/rmt/0 tape drive.
castle# pkgrans -s /var/spool/pkg /dev/rmt0
You can then use the pkgadd command with the -d option to install the datastream packages, as shown in the following example.
castle# pkgadd -d /tmp/raw-pkg-file
The following packages are available:
1 SUNWab2r AnswerBook2 Documentation Server
(sparc) 3.0,REV=2000.0804
2 SUNWab2s AnswerBook2 Documentation Server
(sparc) 3.0,REV=2000.0804
3 SUNWab2u AnswerBook2 Documentation Server
(sparc) 3.0,REV=2000.0804
Select package(s) you wish to process (or 'all' to process
all packages). (default: all) [?,??,q]:
3.136.233.25