I would like to install program foo using emerge on a Gentoo system; so I simply use emerge foo to install and portage selects the most current version of that software that's in its repository. If I know the version number and the naming covnention, I can do emerge =foo.1.2 and use eselect to chose what the currently inforce package is out of the installed ones, if the package supports it.

But what if I don't know the version number or naming convention and just want a list of what's versions of foo are available to me? I don't see an emerge option that does this and snooping around under /usr/portage doesn't yield me anything.

Bonus: Is there anyway to find what locations emerge polls to determine what packages are available? For example, many of the ebuilds on my systems are in nonstandard locations, but emerge finds them anyway, so I'm attempting to determine how emerge builds it's list of available software versions.

  • Maybe emerge --info =foo* or with --search instead or something like that from the atom syntax?
    – user44370
    May 30, 2014 at 1:37
  • You need to read up on man portage Look for the PORTDIR Variable. The location of your Portage Tree is determined by the setting of that variable As a shortcut try ls ${PORTDIR}
    – eyoung100
    Dec 3, 2014 at 18:16
  • @inetplumber care to select an answer?
    – lkraav
    Jun 2, 2015 at 19:06

4 Answers 4


Another way would be to list available keywords with equery, this will also show the versions available.

$ [-] equery y pidgin
Keywords for net-im/pidgin:
             |                             | u   |  
             | a a   a           p     s   | n   |  
             | l m   r h i m m   p s   p   | u s | r
             | p d a m p a 6 i p c 3   a x | s l | e
             | h 6 r 6 p 6 8 p p 6 9 s r 8 | e o | p
             | a 4 m 4 a 4 k s c 4 0 h c 6 | d t | o
   2.10.9    | + + + o ~ + o o + + o o + + | o 0 | gentoo
[I]2.10.9-r1 | ~ + ~ o + ~ o o + ~ o o ~ + | o   | gentoo

I would've expected emerge --search to provide this functionality, alas it only seems to show latest version.

$ [-] emerge --search eix
[ Results for search key : eix ]
[ Applications found : 1 ]

*  app-portage/eix
      Latest version available: 0.29.3
      Latest version installed: 0.29.3
      Size of files: 536 kB
      Homepage:      http://eix.berlios.de
      Description:   Search and query ebuilds, portage incl. local settings, ext. overlays, version changes, and more
      License:       GPL-2

So to answer your question: I've been using eix for so long, I don't really remember what I did before.

$ [-] eix eix$ -c
[I] app-portage/eix
     Available versions:  0.25.5{tbz2} 0.29.3{tbz2} ~0.29.6 ~0.30.0 ~0.30.1 {clang debug +dep doc nls optimization security sqlite strong-optimization strong-security swap-remote tools zsh-completion LINGUAS="de ru"}
     Installed versions:  0.29.3{tbz2}(10:44:38 07.09.2013)(dep nls -clang -debug -doc -optimization -security -sqlite -strong-optimization -strong-security -swap-remote -tools -zsh-completion LINGUAS="-de -ru")
     Homepage:            http://eix.berlios.de
     Description:         Search and query ebuilds, portage incl. local settings, ext. overlays, version changes, and more
  • I absolutely will second eix as the Goto Tool. +1
    – eyoung100
    Dec 3, 2014 at 18:18

While I would recommend lkraav's solution, here is another way:

$ ls /usr/portage/app-portage/eix/
ChangeLog  eix-0.25.5.ebuild  eix-0.29.6.ebuild  eix-0.30.1.ebuild
Manifest   eix-0.29.3.ebuild  eix-0.30.0.ebuild  metadata.xml

this will of course only give you list of all ebuilds available for eix in the portage tree (without all the nice info which eix does provide). If you are using layman more ebuilds will be available in overlays (basically in other folders).

  • ls -1 perhaps gives a better one-column view for this.
    – lkraav
    Dec 3, 2014 at 22:15
  • I like this method in combination with knowing the system's PORTDIR locations. Jun 10, 2015 at 11:04
  • This method doesn't provide information on what's installed, which binary packages are built, etc
    – lkraav
    Aug 11, 2016 at 8:15
  • /usr/portage/ is an older location where portage stored its build information. In 2023, you would want /var/db/repos/gentoo/ Jul 20, 2023 at 19:02

Yet another way and the one I use 90% of the time:

equery list -po [package_name]

You must log in to answer this question.

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