Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?)

share|improve this question
up vote 0 down vote accepted

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.

share|improve this answer
So, do you know a way to install all solaris-desktop pakages? This is what I actually need. – pavelartlover Oct 10 '13 at 13:53
@pavelartlover: pkg install solaris-desktop will perform all magic required... . – Vincent De Baere Oct 10 '13 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? – pavelartlover Oct 10 '13 at 14:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.