2

This is a followup question to my former question apt-rdepends does not show multiarch information.

With that problem solved, I've now encountered the issue that apt-cache will recurse over all alternatives for a dependency:

$ apt-cache depends --recurse --no-recommends --no-suggests --no-breaks --no-suggests --no-replaces --no-conflicts --no-pre-depends nano 
nano
  Depends: libc6
  Depends: libncursesw5
  Depends: libtinfo5
 |Depends: dpkg
    dpkg:i386
  Depends: install-info
    install-info:i386
libc6
  Depends: libgcc1
libncursesw5
  Depends: libtinfo5
  Depends: libc6
  Recommends: libgpm2
libtinfo5
  Depends: libc6
dpkg
dpkg:i386
install-info
  Depends: libc6
install-info:i386
  Depends: libc6:i386
libgcc1
  Depends: gcc-4.9-base
  Depends: libc6
libgpm2
  Depends: libc6
libc6:i386
  Depends: libgcc1:i386
gcc-4.9-base
libgcc1:i386
  Depends: gcc-4.9-base:i386
  Depends: libc6:i386
gcc-4.9-base:i386

This currently blows up my package list by about 300%.

Any suggestions on how to force it to use only the preferred alternatives (in the example: not the i386 packages)?

1 Answers1

1

Had the same issue. I found that one can use

-o APT::Cache::ShowOnlyFirstOr=true

which solves a bit of the problem, however not completely - for example when you have multiarch and the same package is provided in both architectures (i.e not OR but actually two packages that can be used), then you get recursion on both.

I guess I should warn you that this option does not seem to be documented anywhere. Also, I do not know if the prefered option is always first.

(See how 'ShowOnlyFirstOr' is used in https://salsa.debian.org/apt-team/apt/blob/master/apt-private/private-depends.cc )

Octetz
  • 11