Pkgcore

Pkgcore is one of the alternative package managers that can be used to replace Portage. Like Portage, it is written in Python. However, unlike for example Paludis, pkgcore is meant as a drop-in replacement. Thus pkgcore's command syntax is very similar to the Portage's.

Pkgcore splits the emerge functionality into three separate tools:
 * pmerge : For installing, upgrading, uninstalling and so on.
 * pmaint : For repository maintenance, this includes features like those of emerge --sync, but also a lot more.
 * pquery : For searching the Portage tree. Like emerge -s/-S but much much more advanced (so more like eix).

There are also a few other tools that aren't used as often (such as pconfig and a few others).

Installing pkgcore
If you run stable Gentoo you will need to add two lines to. Assuming you are on stable x86 the lines would be:

If you are not on x86 replace the x86 bit of the line with the relevant arch keyword.

Then emerge pkgcore:

Using pkgcore
This sections will try to describe what the pkgcore commands are for some common Portage commands. Thus it assumes you have used Portage before. Most likely almost all Gentoo users have used Portage a lot.

Most of the Portage features have been implemented in pkgcore, but a few are not yet implemented. Pkgcore also have several features that Portage lacks.

Installing, uninstalling and upgrading
These commands are very similar to the Portage ones:

Most of the other Portage flags are also available such as -a, -f and so on See also the official documentation of pkgcore for more details.

Syncing Portage tree
For Portage this would be:

For pkgcore it is:

Searching
Most experienced Gentoo users would use a tool like eix or such since emerge -S is so slow.

While pquery is faster than emerge -S, eix is still quite a bit faster. However pquery has a lot more features than both emerge -S and eix.

A few basic examples:

Some of the pquery flags can be hard to guess what they mean:

More examples can be found in the official documentation.

Missing commands
A few common Portage commands that have no pkgcore equivalent: See also the the official documentation for some more uncommon missing ones.

pkgcore features that Portage is missing
There are a few totally new options: This is like emerge --resume --skipfirst but without interrupting the build. To quote the official documentation: "This preloads the installed packages database, causing the resolver to work with a complete graph, disallowing actions that conflict with installed packages. If it's disabled, it's possible for the requested action to conflict with already installed dependencies that aren't involved in the graph of the requested operation." - portage includes this since 2.2 with --keep-going.

pquery also supports constructing very complex queries, and searching for maintainer, license and so on. While there are many other tools such as eix and equery that together can do most of (but not all) the individual searches of pquery, they are hard to combine.

For example, search for packages in a category starting with dev that are in the python herd and are not licensed under GPL-2 or MIT:

If you’re used to eix, but want to avoid the manual cache refresh, for you can get similar output via:

This shows stable and testing packages (--raw) and combines all versions into one item (-nv). Add --attr=keywords to also see the keywords for the latest package. You need to provide explicit * around the keyword to get eix-like matching, though:

Use --vdb to see only installed packages.

For more details see the pquery documentation.

Internally there are other features that Portage is missing as well, though fewer than before if compared to the not yet stable portage-2.2.