1

1) Here is the command to install special package (for example system/header)

#pkg install system/header

2) ALso we can install several packages

#pkg install system/header network/ssh package/rpm

3) Here is the command to show all available packages from special group

#pkg contents -o fmri -H -rt depend -a type=group solaris-desktop

How to install all packages from a special group in one command? (How to send output from the third command as an argument to second?)

1 Answers1

0

xargs is your friend... :

vdebaere@toto:~$ printf "test1\ntest2\ntest3" |xargs echo
test1 test2 test3

Applied to your example:

root@toto:~# pkg contents -o fmri -H -rt depend -a type=group solaris-desktop | xargs pkg install -n

Mind you that in the case of pkg install, this will not work as such, as the output of the second command can and will contain packages that can be satisfied in different ways (e.g. network/telnet matches both pkg://solaris/service/network/telnet and pkg://solaris/network/telnet.

Vincent De Baere
  • 1,783
  • 9
  • 9