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 Answer 1

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.

3
  • So, do you know a way to install all solaris-desktop pakages? This is what I actually need. Oct 10, 2013 at 13:53
  • @pavelartlover: pkg install solaris-desktop will perform all magic required... . Oct 10, 2013 at 13:56
  • I check pkg info solaris-desktop it is already installed. And it size is only 5.46 kb. But I want to install all packages from this group. Can you give me another advice? Oct 10, 2013 at 14:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .