Gentoo:Masked ebuilds
From Linux 101, The beginner's guide to all things Linux.
The portage tree handles unstable package versions through the use of keywords. If a package is deemed unstable and you do not have a keyword allowing you to install unstable packages in either your package.keywords file or your make.conf file then you will either not receive notification of a new version while executing an update or will receive an error message like so:
!!! All ebuilds that could satisfy "=ati-drivers-8.16.20-r1" have been masked. !!! One of the following masked packages is required to complete your request: - media-video/ati-drivers-8.16.20-r1 (masked by: -* keyword)
As you can see, this specific version of the ati-drivers is currently masked. It states at the end of the message that it is masked by the -* keyword which will be explained next. The following assumes you are running an x86 architecture, although there are mentions of other ones.
Contents |
[edit] Reasons for a masked ebuild
[edit] make.conf keyword
Inside of the make.conf file, you will find a setting called ACCEPT_KEYWORDS. This is where portage will draw on to find out your CPU's architecture and whether or not you would like to use unstable packages. If you are running on an x86 architecture (all Pentium-class computers) then your keyword for stable packages will be x86. A processor that has gained acceptance that is built on the x86 architecture is the AMD Athlon 64, which, while still an x86 processor, it has 64-bit extensions which calls for a different keyword. In this case, x86_64. For instance, inside the make.conf file will be:
ACCEPT_KEYWORDS="x86"
This is the default for a Gentoo installation and will usually be what you want to have. By default, there is only one package.mask file on your Gentoo system. This file is housed under the portage directory in the directory profiles. In this file, the Gentoo developers have added a number of packages that they feel need to be hidden from normal users in order to either prevent a flaw, security or otherwise, in them from harming users, or because the program simply has had no testing and there is no reason for a normal user to try it out yet. If something is included in the package.mask file, then it does not matter what keyword you have, the package will be ignored. The secondary, optional package.mask file is located in the /etc/portage directory, which you would need to create if you do not have and would like to define a package that you want masked. This file should be where a user puts all packages they want to be masked. To mask a specific version of a package, execute
- #
echo "=<package-category>/<package-name>-<package-version>" >> /etc/portage/package.mask
The equal sign can be replaced with the < (older than), >(newer than), <= (older or equally old) or >= (newer or equally new). For example, if you wanted to mask the latest version of apache at the time of this writing, you would execute the following:
- #
echo "=net-www/apache-2.0.54-r31" >> /etc/portage/package.mask
However, as stated, this will only mask a specific version of the package. If you would like for an entire package to be masked, dropping the boolean operator (in the previous case '=') and package-version will mask all versions.
- #
echo "net-www/apache" >> /etc/portage/package.mask
[edit] Installing masked packages
If you have need of an unstable package or would like to test it out, there are a couple of ways to make them available.
[edit] ACCEPT_KEYWORDS
A package can be masked through use of a keyword. If you would like to install all of the latest, but considered to be unstable versions of packages then you must change your keyword in your make.conf file. Adding
ACCEPT_KEYWORDS="~x86"
in place of your previous ACCEPT_KEYWORDS line will tell portage that all packages masked by the ~x86 keyword, those which are considered to be unstable on the x86 platform, should be unmasked. This will usually get you the latest available versions of most software. As displayed at the introduction of this article, there is a -* keyword. This keyword masks the package to all architectures and does not allow installation of a package even if the ~x86 keyword is in use. To enable the installation of all -* masked packages, use
ACCEPT_KEYWORDS="-*"
This, however, is generally considered a bad idea as if a package is masked on all architectures, there is a good reason. Using this, you will almost definitely run into many issues both with installing packages and running your system in general.
[edit] package.keywords
If you would only like to unmask a specific package that is masked through a keyword without modifying the rest of the packages, then the package.keywords file, housed inside the /etc/portage directory, is where these should be placed. It works along the exact same lines as the package.mask file.
- #
echo "=net-www/apache-2.0.54-r31 *" >> /etc/portage/package.keywords
This is the same statement as above, only this time the package is unmasked for the unstable branch of whatever architecture you are using. Once again, if you would like to unmask all unstable versions of a package then remove the '=' and version number.
- #
echo "net-www/apache *" >> /etc/portage/package.keywords
One caveat of this is that it does not unmask those packages which are masked using -*. These packages require that you specify the keyword.
- #
echo "net-www/apache -*" >> /etc/portage/package.keywords
Now all versions of apache are available to be installed with the latest version being selected by portage if no version is specified.
[edit] package.unmask
package.unmask is the file in which you would unmask packages masked by the package.mask file. These so-called "Hard Masked" packages are usually done so for very good reason. Unmasking of these is not recommended unless you know what you are doing. The file works the same as all of the other package.* files in that adding the package-directory, package-name and package-version will be all that is required.
- #
echo "=net-www/apache-2.0.54-r31" >> /etc/portage/package.unmask
This will unmask apache version 2.0.54-r31 from the package.mask file (if it is there) but leave other versions masked. To unmask all versions should they ever be added to the package.mask file, remove the version number and '='
- #
echo "net-www/apache" >> /etc/portage/package.unmask
|
Note: The use of unstable software on production servers or workstations is discouraged as their use can cause any number of unknown problems. These packages are masked due to known problems or lack of testing and the stable versions are usually much more reliable. |
| Navigation: Gentoo Index |

