I have a directory with every package I require. Don't really want to go through several dozen files and manually invoke pkgadd for them.
Is there a way to automate this process or call pkgadd to have it install everything in the directory?
Thank you.
Solaris packages can be stored as a single file, or as a directory tree of files. The -d option supports installing multiple packages if they're stored in the directory tree format. You can use
pkgtrans
to unpack package files:This would create a directory
/var/tmp/pkgs/FOObar
, containing the files and subdirectories that make up the package. You could unpack all of your packages into the same place, then run:to install all of them at once.
I haven't tried this, but the pkgadd
-s
option claims to unpack packages to/var/spool/pkg
, and pkgadd without -d looks for packages in that directory. So the sequence:will probably also work.
This should get you started-you'll want to pretty it up and extend it if you're actually going to use it. Right now it won't handle spaces of control characters in filenames gracefully. And if this is on Solaris you'll probably have to tweak the location of sh.
pkgadd -d /path/to/directory all
should do what you want. However, if some of the packages depend on others, instead ofall
you'll need to list them in the order they should be installed.