Add new post

This commit is contained in:
2026-06-09 00:10:42 +02:00
parent d192b0208b
commit afb169bb45

View File

@@ -0,0 +1,32 @@
---
layout: default
title: Portage cheat sheet
date: 2026-06-08 23:08 +0200
tags: Gentoo Portage
---
h3. 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
{% highlight file caption=/etc/portage/package.mask/kernel %}
sys-kernel/gentoo-sources
{% endhighlight %}
then unmask the only slot that is to be kept installed:
{% highlight file caption=/etc/portage/package.unmask %}
sys-kernel/gentoo-sources:6.6.142
{% endhighlight %}
*Notes:*
* masking by version @>@ installed version will not work, as @emerge@ may
pick for installation any unmasked slot below installed version,
* masking both @>@ and @<@ installed version is somewhat redundant,
* @emerge@ does not recognize @!@ atom operator.