4

I'm using apt-rdepends on an amd64 system with i386 as a foreign architecture. But it seems that apt-rdepends loses the architecture information of packages:

$ apt-rdepends libgcc1:i386
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libgcc1:i386
  Depends: gcc-4.9-base (= 4.9-20140406-0ubuntu1)
  Depends: libc6 (>= 2.2.4)
  PreDepends: multiarch-support
gcc-4.9-base
libc6
  Depends: libgcc1
libgcc1
  Depends: gcc-4.9-base (= 4.9-20140406-0ubuntu1)
  Depends: libc6 (>= 2.14)
  PreDepends: multiarch-support
multiarch-support
  Depends: libc6 (>= 2.3.6-2)

While apt-cache shows the correct architecture but can't recurse:

$ apt-cache depends libgcc1:i386
libgcc1:i386
  Depends: gcc-4.9-base:i386
  Depends: libc6:i386
  PreDepends: multiarch-support:i386
    multiarch-support
  Breaks: <gcc-4.3>
  Breaks: <gcc-4.3:i386>
  Breaks: gcc-4.4
  Breaks: gcc-4.4:i386
  Breaks: <gcc-4.5>
  Breaks: <gcc-4.5:i386>
  Replaces: libgcc1
  Breaks: libgcc1

Any suggestions on how to recursively retrieve dependencies without losing architecture information?

Stephen Kitt
  • 434,908
  • Did you try the solutions of this post? https://unix.stackexchange.com/questions/188964/how-can-i-get-recursively-list-an-apt-packages-dependencies-with-their-installe – Mokkun May 09 '17 at 09:37
  • Yes, I did. But debfoster only seems to work on already installed packages which doesn't help me. But I've found http://stackoverflow.com/questions/22008193, which points out that there's apt-cache depends --recurse. So that's what I'm currently trying. Results should be in in about 30 minutes. – Hurzelchen May 09 '17 at 09:42

2 Answers2

2

As you discovered, apt-cache depends--recurse option provides a recursive variant. For that to be useful, you need to disable a few dependency types:

$ apt-cache depends --recurse --no-breaks --no-replaces --no-suggests libgcc1:i386

libgcc1:i386
  Depends: gcc-6-base:i386
  Depends: libc6:i386
gcc-6-base:i386
libc6:i386
  Depends: libgcc1:i386
  Replaces: libc6-i686:i386
    libc6:i386
libc6-i686:i386

apt-rdepends is orphaned and hasn’t been updated to properly support multi-arch. (I’d say it’s unlikely that it will ever be at this point.)

Stephen Kitt
  • 434,908
1

As posted in my comment, apt-cache depends has a --recurse option itself.

Turning off all other package relations than Depends and PreDepends, I get the output that I need:

$ apt-cache depends --recurse --no-recommends --no-suggests --no-conflicts --no-breaks --no-replaces --no-enhances
libc6:i386
  Depends: libgcc1:i386
libgcc1:i386
  Depends: gcc-4.9-base:i386
  Depends: libc6:i386
  PreDepends: multiarch-support:i386
    multiarch-support
gcc-4.9-base:i386
multiarch-support:i386
  Depends: libc6:i386
multiarch-support
  Depends: libc6
libc6
  Depends: libgcc1
libgcc1
  Depends: gcc-4.9-base
  Depends: libc6
  PreDepends: multiarch-support
    multiarch-support:i386
gcc-4.9-base