Knowledge Base:Unmasking a package

From Gentoo Wiki
Jump to:navigation Jump to:search


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 <> (24 Jun 2019)
# Source is broken. Upstream is dead since 2011.
# Removal after 2019-08-01. (bug #688552)

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] 


Any Gentoo installation.


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.


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-

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-

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-" >> /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- package as mentioned earlier, run:

root #echo "=x11-base/xorg-server-" > /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