This is Gentoo's testing wiki. It is a non-operational environment and its textual content is outdated.

Please visit our production wiki at https://wiki.gentoo.org

Knowledge Base:Accepting a keyword for a single package

From Gentoo Wiki (test)
Jump to:navigation Jump to:search

Synopsis

During installation of a package, Portage complains that the package can only be installed if a keyword change is made:

root #emerge --ask dev-perl/Term-Screen
[ebuild N     ~] dev-perl/Term-Screen-1.30.0

The following keyword changes are necessary to proceed:
#required by Term-Screen (argument)
=dev-perl/Term-Screen-1.30.0 ~amd64

Environment

Any Gentoo Linux environment.

Analysis

Every Gentoo ebuild (package) has a set of KEYWORDS values that are referenced when it compiles. These keywords identify for which architectures the ebuild is installable, and if the ebuild is stable (no prefix) or still in testing phase (prefixed by ~).

When trying to install the package, Portage found that the only way it can honor the request (either because the specific package was asked for, or because it is being pulled in as a dependency) as if Portage was been told that it can install the ~arch version of a package. In the example above, it would be ~amd64 since the system on which the example is tried is an amd64 architecture (x86_64).

In certain cases, the package is defined with no KEYWORDS content. In this specific case, Portage will suggest to use the special ** keyword value to override.

Resolution

This assumes that the user is comfortable with installing testing ebuilds. If this is an error (testing ebuilds are not desired but the stable ebuilds do not suffice for the installation), check with the Gentoo developers and, if necessary, open a bug report.

Using --autounmask-write

Re-running the command with --autounmask-write automatically queues the required text file alteration:

root #emerge --ask --autounmask-write dev-perl/Term-Screen

As with all conf files, the final update is made by running dispatch-conf (or alternatively etc-update):

root #dispatch-conf

Examine the diff output, press q to exit the pager (if commands at the end), and then u for use-new to accept the alterations.

Re-run the emerge one last time:

root #emerge --ask dev-perl/Term-Screen

Manual resolution

Using traditional files

Create the /etc/portage directory if it does not exist yet:

root #mkdir --parents /etc/portage

Add the required line:

root #echo "=dev-perl/Term-Screen-1.30.0 ~amd64" >> /etc/portage/package.accept_keywords

Using directories

Create the /etc/portage/package.accept_keywords directory if it does not exist yet:

root #mkdir --parents /etc/portage/package.accept_keywords

Next, create a file in to tell Portage which ebuilds to accept for installation. For instance, if you want to install Term-ScreenColor but Term-Screen fails, create a file named Term-ScreenColor (this filename is used to the user has a reference as to why they deviated from the standard keywords) in which the Term-Screen deviation is placed:

root #echo "=dev-perl/Term-Screen-1.30.0 ~amd64" >> /etc/portage/package.accept_keywords/Term-ScreenColor

Additional notes

To also let in -r# package revisions which may contain immediately beneficial updates, replace the leading = (equals sign) with a ~ (tilde):

~dev-perl/Term-Screen-1.30.0 ~amd64

The keyword itself can usually be omitted:

~dev-perl/Term-Screen-1.30.0

To always install the latest testing version, drop the leading = or ~ as well as the version at the end:

dev-perl/Term-Screen

If the mask is because no KEYWORDS are defined, use the ** notation:

~sys-apps/portage-9999 **