Portage cheat sheet

Disallow installation of new slot (NS) version on update.

Problem: there is a package that comes with separate slot for every version. Notable example is sys-kernel/gentoo-sources. Each @world update attempt tries to install new package slot. If kernel is not to be updated, not only additional files will take space unnecessarily, but if emerge --depclean is run afterwards, the current kernel sources are selected for removal (!).

Solution: mask all package slots

FILE:/etc/portage/package.mask/kernel
sys-kernel/gentoo-sources

then unmask the only slot that is to be kept installed:

FILE:/etc/portage/package.unmask
sys-kernel/gentoo-sources:6.6.142

Notes: