Portageq

portageq is a tool to quickly query Portage information. It is primarily used by Gentoo developers in order to determine Portage configuration information.

Installation
Every Gentoo system should have installed. Run a quick test by issuing the the  option as seen in the usage section below.

If usage instructions are not displayed to the terminal there is certainly a problem. It is possible to (re)install Portage by following the Portage installation instructions.

Querying environment variables
Probably the only question users will have as they read through the help output above is the definition of eroot. eroot simply means the repository filesystem path (directory) and can be obtained by:

Queryable Portage specific environmental variables are listed in. The queryable user environment's environment variables can be shown using the command.

Return the CONFIG_PROTECT variable value (should be a filesystem path):

Return the DISTDIR variable value (should be a filesystem path):

Return the PKGDIR variable value (should be a filesystem path):

Query repository information
To see a detailed list of repositories as configured in repos.conf, without any formatting:

As before, but without details:

Removal
Simply put, removing the package management system on Gentoo is a bad idea. Do not do it!