Knowledge Base:Unmasking a package
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:
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 <firstname.lastname@example.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]
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.
Re-running the emerge command with
--autounmask-write automatically queues the required text file alteration:
emerge --ask --autounmask-write =xorg-server-22.214.171.124
As with all configuration files, the final update is made by running dispatch-conf (or alternatively etc-update):
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:
emerge --ask =xorg-server-126.96.36.199
Using traditional files
Create the /etc/portage directory if it does not yet exist:
mkdir -p /etc/portage
Add the required line to a (new) package.unmask file:
echo "=x11-base/xorg-server-188.8.131.52" >> /etc/portage/package.unmask
Create the /etc/portage/package.unmask directory if it does not yet exist:
mkdir -p /etc/portage/package.unmask
Create a file (or files) for the unmask operations to perform. For instance, to unmask the
xorg-server-184.108.40.206 package as mentioned earlier, run:
echo "=x11-base/xorg-server-220.127.116.11" > /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.