User:Sam/Portage help/Understanding REQUIRED USE

From Gentoo Wiki
Jump to:navigation Jump to:search

Dissecting REQUIRED_USE

A REQUIRED_USE constraint message looks something like this:

 The following REQUIRED_USE flag constraints are unsatisfied:
   foo? ( bar )

 The above constraints are a subset of the following complete expression:
   foo? ( bar ) baz? ( ... ) ...

There are two parts to the constraint message:

  1. The unsatisfied constraints.
    • This is the part to pay attention to, and it gives the changes that are required to proceed.
  2. The full USE constraints for the package.
    • This is just to give the surrounding context for the above and should not be used to pick out USE flag changes. If it's not listed in the first section, then the constraints are already satisfied.

Example 1

Here's a typical example of a REQUIRED_USE error/conflict:

root #emerge -p -uvDU @world
[...]
!!! The ebuild selected to satisfy "media-libs/libsdl2" has unmet requirements.
- media-libs/libsdl2-2.0.16-r1::gentoo USE="X alsa dbus joystick opengl pulseaudio sound threads udev video wayland (-aqua) (-custom-cflags) -doc -fcitx4 -gles1 -gles2 -haptic -ibus -jack -kms -libsamplerate -nas -oss -pipewire -sndio -static-libs -vulkan -xinerama -xscreensaver" ABI_X86="(64) -32 (-x32)" CPU_FLAGS_X86="mmx sse sse2 -3dnow" VIDEO_CARDS="(-vc4)"

  The following REQUIRED_USE flag constraints are unsatisfied:
    wayland? ( gles2 )

  The above constraints are a subset of the following complete expression:
    alsa? ( sound ) fcitx4? ( dbus ) gles1? ( video ) gles2? ( video ) haptic? ( joystick ) ibus? ( dbus ) jack? ( sound ) nas? ( sound ) opengl? ( video ) pulseaudio? ( sound ) sndio? ( sound ) vulkan? ( video ) wayland? ( gles2 ) xinerama? ( X ) xscreensaver? ( X )

(dependency required by "dev-libs/efl-1.25.1-r13::gentoo[sdl]" [installed])
(dependency required by "x11-wm/enlightenment-0.24.2-r2::gentoo[wayland]" [installed])
(dependency required by "@selected" [set])
(dependency required by "@world" [argument])
[...]

Let's break this down a bit. The key part is:

  The following REQUIRED_USE flag constraints are unsatisfied:
    wayland? ( gles2 )

i.e. "If the wayland USE flag is enabled for media-libs/libsdl2, you must enable the gles2 flag for it as well."

Example 2

Here's another example:

root #emerge -p -uvDU @world
[...]
!!! The ebuild selected to satisfy "sys-fs/lvm2[static-libs(+)]" has unmet requirements.
- sys-fs/lvm2-2.03.14-r1::gentoo USE="device-mapper-only lvm2create-initrd readline sanlock static-libs systemd thin udev (-selinux) -static" ABI_X86="(64)"

The following REQUIRED_USE flag constraints are unsatisfied:
device-mapper-only? ( !lvm2create-initrd !sanlock !thin ) static-libs? ( static !udev )

The above constraints are a subset of the following complete expression:
device-mapper-only? ( !lvm2create-initrd !sanlock !thin ) static? ( !systemd !udev ) static-libs? ( static !udev ) systemd? ( udev )

Let's break this down a bit. The key part is:

  The following REQUIRED_USE flag constraints are unsatisfied:
    device-mapper-only? ( !lvm2create-initrd !sanlock !thin ) static-libs? ( static !udev )

There's two parts to this:

  1. If the device-mapper-only USE flag is enabled for sys-fs/lvm2, you must turn off the lvm2create-initrd, sanlock, thin flags
  2. If the static-libs USE flag is enabled, you must have the static flag on and the udev flag off.

Operators

REQUIRED_USE operators
Name Operator Example Meaning
if ? wayland? ( gles2 ) Wayland support requires GLES2. Either turn on gles2 or disable wayland for this package.
at-most-one-of ?? ?? ( libedit readline ) libedit support is mutually exclusive with readline support. You can either enable neither or just one. Not both.
any-of || || ( ncurses wayland X ) You must enable at least one of ncurses, wayland, or X for this package. 1 is okay, more than 1 is okay, 0 is not okay.
exactly-one-of ^^ ^^ ( elogind systemd ) The package needs either elogind or systemd. You must ensure exactly one is enabled (not two, not zero!)
negation/disable/off ! !static-libs The package or another USE flag needs the static-libs flag to be disabled/turned off.

See Also