SLOT

From Gentoo Wiki
(Redirected from Slot)
Jump to:navigation Jump to:search

The SLOT ebuild variable specifies a package version's slot. Slots can allow multiple versions of a package to be installed and managed simultaneously by Portage.

Version specifiers

Slotted versions are denoted by adding a colon (:) plus the slot name after the package version. For example, slot 3 of x11-libs/gtk+-3.24.39::gentoo can be specified using x11-libs/gtk+-3.24.39:3::gentoo.

Behavior

Every package version has one slot. Versions in different slots can be installed simultaneously. For example, to install sys-kernel/gentoo-kernel-6.6.21:6.6.21 alongside sys-kernel/gentoo-kernel-6.1.81:6.1.81, the following command can be used:

root #emerge --ask gentoo-kernel:6.6.21 gentoo-kernel:6.1.81

This installs sys-kernel/gentoo-kernel-6.6.21 into slot 6.6.21 and sys-kernel/gentoo-kernel-6.1.81 into slot 6.1.81:

user $eselect kernel list
Available kernel symlink targets:
  [1]   linux-6.1.81-gentoo *
  [2]   linux-6.6.21-gentoo

A package version can only be installed into its own slot. Thus, sys-kernel/gentoo-kernel-6.1.81 cannot be installed into slot 6.6.21, 6, or foo.

How different packages use slotting

Most packages don't use slots.

As can be inferred from section Behavior, sys-kernel/gentoo-kernel uses a different slot for each version. Some packages, such as sys-devel/gcc, use different slots for different major revisionssys-devel/gcc-13.2.1_p20240210:13 can be installed alongside sys-devel/gcc-14.0.1_pre20240317:14, but not alongside sys-devel/gcc-13.2.1_p20240113-r1:13.

In general, if two package versions own a few of the same files, they cannot be installed simultaneously, so they are placed in the same slot. Packages such as sys-kernel/gentoo-kernel and sys-devel/gcc incorporate the slot into the installed filenames (e.g. /boot/kernel-6.8.6-gentoo-dist and /usr/x86_64-pc-linux-gnu/gcc-bin/13/gcc), eliminating conflicts between slots.

Listing package slots with eix

eix (from the app-portage/eix package) can be used to list a single package's slotted versions.

Before performing any operations using eix, update its database:

user $eix-update

List the available versions:

user $eix -e dev-lang/lua
[I] dev-lang/lua
     Available versions:  
     (5.1)  5.1.5-r200
     (5.3)  5.3.6-r102
     (5.4)  5.4.6
       {+deprecated readline}
     Installed versions:  5.1.5-r200(5.1)(06:33:41 25/03/2024)(deprecated readline) 5.4.6(5.4)(04:58:26 25/03/2024)(deprecated readline)
     Homepage:            https://www.lua.org/
     Description:         A powerful light-weight programming language designed for extending applications</blockquote>

The slots are shown in parentheses (5.1, 5.3 and 5.4 in this case).

To prevent packages from being installed into certain slots, add them to /etc/portage/package.mask.

See also

External resources