Is it possible to install items in a package category like games-rpg/ using a single portage command?

I've tried using things like games-rpg/* but I have not managed to get anything working so far.


General Format

# emerge -optionswithnospaces category/package-name-version-x.y.z


You confused, package with category, which I edited. This leads to the answer for your question. Emerge itself cannot emerge packages by wildcarding the category, as the dependency checker expects at least one package.


This leaves us with two options:

  1. Write a For Next BASH Loop. This requires app-portage/portage-utils. Something close to emerge -av $(for name in $(qlist -IC | grep -v '^games-rpg/') etc etc Personally, I hate that method, as it takes time for me to debug. There are some great scriptors on this Exchange if you decide to go this route.
  2. Create a custom package set. This requires a bit of tedious work, as you must manually add each package in the category, in case you don't want something from the category installed, or you can actually use what you had discovered.

nano -w /etc/portage/sets/rpg-games

Add the following:


And then emerge -av @rpg-games

Portage can actually expand the Wildcard if the wildcard is listed in the set. I believe this works through buffer magic, but don't quote me on it. The emerge shell forks open a temporary file, lists all the items selected by the wildcard, gathers the list and sends it as input, then closes the temporary file.

For more on Wildcards and Portage, read the GLOSSARY Section in man portage. Here's the online copy.

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.