Portage Dependency Resolution

From Steak Wiki
Jump to navigationJump to search

In Funtoo/Gentoo There can be times when portage will require adjustments.

Here are some examples:

Example 1: Basic "The following REQUIRED_USE flag constraints are unsatisfied:"

# emerge -av <somepackage>

These are the packages that would be merged, in order:

Calculating dependencies... done!

!!! The ebuild selected to satisfy "app-arch/gcab" has unmet requirements.
- app-arch/gcab-1.3::gnome-kit USE="vala -doc -introspection -test"

  The following REQUIRED_USE flag constraints are unsatisfied:
    vala? ( introspection )

Solution:

  • ego sync (funtoo), emerge --sync OR emerge-webrsync (gentoo)

This is done to get the system up to date. Equivalent to apt-get update.

  • Add introspection to /etc/portage/make.conf in USE
  • emerge desired package.

Note that this isn't package.use, but make.conf in this case. It's evident you need to use make.conf as there are multiple requirements for introspection. i.e. if you add the gcab above with introspection to package.use it then comes back with a "new ebuild has unmet requirements" for something else, again looking for introspection..

Example 2: Multiple Dependencies Required"

See this example, lifted from the Gentoo Forum:[1]


Dan__man wrote:

!!! The ebuild selected to satisfy ">=media-video/ffmpeg-0.10.3:0[X?,encode?,gsm?,jpeg2k?,mp3?,sdl?,speex?,theora?,threads?,truetype?,vaapi?,vdpau?,x264?]" has unmet requirements.
- media-video/ffmpeg-1.0.8::gentoo USE="X aac aacplus alsa bindist bzip2 cdio encode faac hardcoded-tables ieee1394 jack libv4l mmx mp3 (multilib) network openssl schroedinger theora truetype twolame v4l vorbis x264 xvid zlib -3dnow -3dnowext (-altivec) -amr -avx -bluray (-celt) -cpudetection -debug -doc -examples -fdk -flite -fontconfig -frei0r -gnutls -gsm -iec61883 -jpeg2k -libass -libcaca -mmxext -modplug (-neon) -openal -opus -oss -pic -pulseaudio -rtmp -sdl -speex -ssse3 -static-libs -test -threads -vaapi -vdpau (-vis) -vpx" ABI_X86="64" FFTOOLS="aviocat cws2fws ffeval fourcc2pixfmt graph2dot ismindex pktdumper qt-faststart trasher"

The following REQUIRED_USE flag constraints are unsatisfied:
bindist? ( encode? ( !faac !aacplus ) !openssl )

The above constraints are a subset of the following complete expression:
bindist? ( encode? ( !faac !aacplus ) !openssl ) libv4l? ( v4l ) fftools_cws2fws? ( zlib ) test? ( encode )

(dependency required by "virtual/ffmpeg-0.10.3" [ebuild])
(dependency required by "kde-base/ffmpegthumbs-4.11.2" [ebuild])
(dependency required by "kde-base/kdemultimedia-meta-4.11.2[ffmpeg]" [ebuild])
(dependency required by "kde-base/kde-meta-4.11.2-r1" [ebuild])
(dependency required by "kde-meta" [argument])


Understanding that output will help you more :
first identify the issue :
Quote:
The following REQUIRED_USE flag constraints are unsatisfied:
bindist? ( encode? ( !faac !aacplus ) !openssl )

The above constraints are a subset of the following complete expression:
bindist? ( encode? ( !faac !aacplus ) !openssl ) libv4l? ( v4l ) fftools_cws2fws? ( zlib ) test? ( encode )


The second line tells you the full set of conditions, while the first one, tells you the conditions that are problematic for portage :
ie : suppose you have conditions = "nocats, nobirds, noegg, noflower"
if you have USE="cats" : portage will output
Quote:
The following REQUIRED_USE flag constraints are unsatisfied:
nocats
The above constraints are a subset of the following complete expression:
nocats nobirds noegg noflower


Now you see, you don't really have to care about the 2nd line, so back to the real issue
Quote:
The following REQUIRED_USE flag constraints are unsatisfied:
bindist? ( encode? ( !faac !aacplus ) !openssl )


Well, it's of course easy to understand for portage devs, something they don't really care and just assume everyone is one.
so the human readable version of this is :
if user have "bindist" in USE flag : ( if user have "encode" in use flag ( <user must not have "faac" in use flag> <user must not have "aacplus" in use flag) <user must not have "openssl" in use flag)
Or to a shorter while maybe more readable output
IF "bindist" : ( if "encode" (NO"faac" NO"aacplus") NO"openssl")

That's it, if you have bindist : in all cases you cannot have openssl
and if you have bindist : in case you have "encode" you cannot have "faac" and "aacplus"

There are plenty reasons for such restrictions, for the story here's that case explain :
Code:
equery -u ffmpeg
...
 - - bindist               : Enforces license compatibility constraints via REQUIRED_USE.
...

So this mean openssl faac and aacplus cannot be use to not broke the bindist restriction : so it's just license problem.

Howto solve this is now on your hand :
- You don't care license issue AND you need faac : then remove the restriction, this mean remove "bindist" from your USE flag
Code:
USE="-bindist otherflagsyoulike" emerge ffmpeg

- You care about license issue : then remove all offending flags when you use "bindist" : this mean remove "openssl" "faac" and "aacplus"
Code:
USE="bindist -aacplus -openssl -faac othersflagyoulike" emerge ffmpeg

ps: the given examples are working, but you should avoid using them like that, using <USE="that" emerge that> will only enable/disable the USE flags for that emerge only. So next time you want "emerge ffmpeg" you must reput them again or the default use flags will be applied and you can refall on the same error.
So fix them really in your make.conf or package.use file.

The zlib trouble is easier to understand :
Quote:
>=sys-libs/zlib-1.2.5.1-r2:0[minizip] required by (dev-db/virtuoso-server-6.1.6::gentoo, ebuild scheduled for merge)
>=sys-libs/zlib-1.2.5.1-r2[minizip] required by (dev-lang/R-3.0.1::gentoo, ebuild scheduled for merge)