Version specifier

From Gentoo Wiki
Jump to:navigation Jump to:search

This is a reference on how to indicate a specific package when interacting with Portage.

A version specifier is the precise format used to tell emerge exactly what package to install, with optional version, slot, or ebuild repository of origin. The format is also used in files in /etc/portage, and generally in Gentoo.

A version specifier is based on the category/package pair, with extra information if necessary. In some case the category may be omitted, if the package name is unique in all ebuild repositories configured with Portage, for example when using the emerge command.

Version specifiers are also known as "DEPEND atoms" in Portage documentation. For the ebuild development perspective, see the Gentoo Development Guide.

Version specifier format



Matches any version of a package.


matches: gtk+-1.2.10-r12
matches: gtk+-2.24.7
matches: gtk+-3.0.12-r1

By version

When specifying a package version, a comparison operator must be used at the beginning of the atom.


Matches version and any revision.


matches: gdb-7.3
matches: gdb-7.3-r1

does not match: gdb-7.3.1


Matches a version by the version range. Note that there's no "." before the "*".


matches: gdb-7.3
matches: gdb-7.3-r1
matches: gdb-7.3.1
Please note that sys-devel/gdb-7.3*, for example, would also match sys-devel/gdb-7.30 (if that actually existed). Also, you cannot avoid this by trying with sys-devel/gdb-7.3.* because 7.3. (with a trailing dot) is not a valid version number.


Matches a version exactly.


matches: firefox-7.0

does not match: firefox-7.0-r1
does not match: firefox-7.0.1


Matches the specified version or any higher version.


matches: python-2.7
matches: python-2.7.1-r1
matches: python-3.2.2


Matches a version strictly later than specified.


matches: python-2.7-r1
matches: python-2.7.1
matches: python-3.2.2

does not match: python-2.7


Matches a version strictly older than specified.


matches: dev-python/beautifulsoup-

does not match: dev-python/beautifulsoup-3.2.0


Matches the specified version or any older version.


matches: udev-171
matches: udev-164-r2

does not match: udev-171-r1



Matches package in the specified package SLOT. Note that there is no prefix.


matches: sqlite-2.8.16-r5

does not match: sqlite-3.7.8

By ebuild repository


Matches a package from a specific ebuild repository. This can be combined with other specifiers. The official Gentoo repository is ::gentoo.


matches: mesa version 9999 from the x11 overlay

does not match: any version from a different overlay.

See also