Knowledge Base:Unmasking a package

From Gentoo Wiki
Jump to: navigation, 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 =xorg-server-
[ebuild     U #] x11-base/xorg-server- [1.11.2-r2]

The following mask changes are necessary to proceed:

#required by =xorg-server- (argument)
# /usr/portage/profiles/package.mask:
# Chí-Thanh Christopher Nguyễn <> (19 Dec 2011)
# Mask prerelease x11 packages


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 /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