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


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.

  • 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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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