Knowledge Base:Unmasking a package

Synopsis

Some software packages are masked so that users can be properly warned before installing them. Any attempt to install such a package results in the warning from Portage that additional changes are needed before it will proceed:

root #emerge --ask media-sound/sfc
These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  N    #] media-sound/sfc-0.018-r1 

The following mask changes are necessary to proceed:
 (see "package.unmask" in the portage(5) man page for more details)
# required by media-sound/sfc (argument)
# /var/db/portage/profiles/package.mask:
# Jonas Stein <jstein@gentoo.org> (24 Jun 2019)
# Source is broken. Upstream is dead since 2011.
# Removal after 2019-08-01. (bug #688552)
=media-sound/sfc-0.018-r1

NOTE: The --autounmask-keep-masks option will prevent emerge
      from creating package.unmask or ** keyword changes.

Would you like to add these changes to your config files? [Yes/No] 

Environment

Any Gentoo installation.

Analysis

Next to the KEYWORDS settings in the ebuild, additional masking is available within Gentoo. Developers can explicitly mask out a package by mentioning it in the package.mask file within the profiles. The masked file can be coupled with an explanation as to why the package has been masked. Common reasons for masking include pre-release (unstable) versions of a certain package, there is no more upstream development, and there are known security issues in the package.

Resolution

Warning
Generally, it is not a good idea to unmask a package since such packages are not meant to be used on production systems or can cause severe breakage on the system. Be sure proper research has been done before deciding to unmask a package.

Using --autounmask-write

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

root #emerge --ask --autounmask-write =xorg-server-1.11.99.2

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

root #dispatch-conf

Examine the diff output of the configuration files, press q to exit the pager (if no commands appear at the end), and then u for use-new to accept the alterations. Press z to zap (disregard) the changes.

Finally, re-run emerge one last time:

root #emerge --ask =xorg-server-1.11.99.2

Manual resolution

Using traditional files

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

root #mkdir -p /etc/portage

Add the required line to a (new) package.unmask file:

root #echo "=x11-base/xorg-server-1.11.99.2" >> /etc/portage/package.unmask

Using directories

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

root #mkdir -p /etc/portage/package.unmask

Create a file (or files) for the unmask operations to perform. For instance, to unmask the xorg-server-1.11.99.2 package as mentioned earlier, run:

root #echo "=x11-base/xorg-server-1.11.99.2" > /etc/portage/package.unmask/xorg-server

Most masked packages will not accept generic keywords, so specific keywords may need to be granted for the masked package.

See also

This article is issued from Gentoo. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.