Apt

apt-rdepends 不顯示多架構資訊

  • May 29, 2017

我正在使用i386作為外部架構apt-rdependsamd64系統。但似乎失去了包的架構資訊:apt-rdepends

$ 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)

雖然apt-cache顯示了正確的架構但不能遞歸:

$ 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

關於如何在不失去架構資訊的情況下遞歸檢索依賴項的任何建議?

正如我在評論中發布的那樣,它本身apt-cache depends有一個--recurse選項。

關閉除Dependsand之外的所有其他包關係PreDepends,我得到我需要的輸出:

$ 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

正如您所發現的,apt-cache depends--recurse選項提供了一個遞歸變體。為此,您需要禁用一些依賴類型:

$ 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孤立的並且尚未更新以正確支持多拱門。(我會說現在不太可能。)

引用自:https://unix.stackexchange.com/questions/363857