Gentoo Wiki


This article is part of the Tips & Tricks series.
Terminals / Shells Network X Window System Portage System Filesystems Kernel Other



A new package is released. For whatever reason, you don't want to install that package. Maybe it doesn't compile on your system, maybe it changed to a new filetype that you don't like, or maybe it doesn't match your decor. But for whatever reason, you don't want it. How do you keep it from automatically downloading and compiling when you run emerge world?

The best way to ignore a package update

There are a few suggested answers.

  1. Run emerge -p world, and then manually update programs one at a time, leaving out the program you don't want.
  2. Place the unwanted package's full name in /etc/portage/profile/package.provided
  3. Place the unwanted package's full name in /etc/portage/package.mask (recommended)

The first is obviously the easiest. Instead of doing an emerge world, run emerge -p world, and then manually emerge the programs you want to update one at a time, with individual emerge commands. However this is time consuming, and can get bothersome if your emerge world has a lot of packages in it. Also, this is only a temporary solution, you have to repeat this step each time you want to emerge world.

The second one looks like it would be a good idea, as anything placed in /etc/portage/profile/package.provided is thought by portage to have been installed already. However, if the program you don't want has other programs that depend upon it, you can run into dependency errors when you run those other programs. Therefore, this is only suggested for packages that have no reverse dependencies.

The third one is probably the best, overall. By placing the program's name and version number in /etc/portage/package.mask, you tell portage not to emerge that program, ever. This can cause issues when compiling programs that depend on your now-masked package, but at least you won't get crashing apps like in #2. Just no apps. :)

if no version number is given in /etc/portage/package.mask, ALL versions (past, current and future) become masked and blocked. However, if the version to be kept is given in /etc/portage/profile/package.provided (here with the actual number of the already installed version), no error messages arise.

Editing package.mask and package.provided

Both package.mask and package.provided are plain text files, and can be edited with any text editor. Both use the same formatting - one package per line, with commented lines starting with a #. The following command will edit package.mask:

nano -w /etc/portage/package.mask 

If, for example, you wanted to make sure that the package gamin isn't ever installed (no matter which version) put


anywhere in the file. However, if you only want to lock down a specific version of gamin, say for example, version 0.0.26-r6, put


in your package.mask file. Mathematical operators like < and > are also allowed, to denote ranges of package versions. Such as


to not upgrade past 0.0.26-r6 or lower than 0.0.26-r6, respectively.

In package.provided the version must be included but without any operator:


(make sure the path /etc/portage/profile/ is used.)

See Also

Portage MAN page
How to use portage correctly

Retrieved from ""

Last modified: Sun, 13 Apr 2008 11:09:00 +0000 Hits: 24,734