Knowledge Base:Unmasking a package

From Gentoo Wiki
Jump to:navigation Jump to:search

Not all software present in the Gentoo repository will be immediately available to install with the emerge command. Software that is broken, for one reason or another, is masked and needs to be explicitly unmasked if it really must be installed.

Warning
Masked packages are not meant to be used or can cause severe breakage on the system. Be sure proper research has been done before deciding to unmask a package.

Trying to emerge a masked package

On trying to install a masked package from the Gentoo repository, emerge will quit after issuing a warning that will look something like this:

root #emerge --ask =dev-java/eclipse-ecj-4.15
These are the packages that would be merged, in order:

Calculating dependencies... done!

!!! All ebuilds that could satisfy "=dev-java/eclipse-ecj-4.15" have been masked.
!!! One of the following masked packages is required to complete your request:
- dev-java/eclipse-ecj-4.15::gentoo (masked by: package.mask)
/var/db/repos/gentoo/profiles/package.mask:
# Miroslav Šulc <fordfrog@gentoo.org> (2020-02-27)
# >=dev-java/ant-eclipse-ecj-4.10 depends on masked >=virtual/{jdk,jre}-11
# www-servers/tomcat >= 9 depends on masked dev-java/eclipse-ecj


For more information, see the MASKED PACKAGES section in the emerge
man page or refer to the Gentoo Handbook.

Unmasking a package

Unmasking a package will enable installation of packages that have been marked against use.

Unmask automatically with emerge --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
Note
See also Knowledge Base:Autounmask-write for more information.

Unmask manually

Flat file

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.

How packages are masked

Developers explicitly mask out a package by mentioning it in the /var/db/repos/gentoo/profiles/package.mask file in each profile. The masked file can be coupled with an explanation as to why the package has been masked.

Packages can also be masked by system administrators using /etc/portage/package.mask.

See Knowledge Base:Masking a package for more information.

See also