使用apt-rdepends查找软件包依赖关系在Debian / Ubuntu上
有时你需要找出包的所有依赖。 本教程介绍如何使用apt-rdepends递归列出Debian / Ubuntu软件包的所有依赖项。
我不会保证这将为您工作!
1安装apt-rdepends
apt-rdepends可以安装如下:
apt-get install apt-rdepends
如果你在Ubuntu上并没有以root身份登录,请使用
sudo apt-get install apt-rdepends
代替。
2使用apt-rdepends
apt-rdepends可以使用如下:
apt-rdepends <packagename>
例如,要查找包wget的
所有依赖项,请运行:
apt-rdepends wget
这是一个示例输出:
falko@falko-virtual-machine:~$ apt-rdepends wget
Reading package lists... Done
Building dependency tree
Reading state information... Done
wget
Depends: dpkg (>= 1.15.4)
Depends: install-info
Depends: libc6 (>= 2.11)
Depends: libssl1.0.0 (>= 1.0.0)
dpkg
PreDepends: coreutils (>= 5.93-1)
PreDepends: libbz2-1.0
PreDepends: libc6 (>= 2.11)
PreDepends: libselinux1 (>= 1.32)
PreDepends: xz-utils
PreDepends: zlib1g (>= 1:1.1.4)
coreutils
PreDepends: libacl1 (>= 2.2.11-1)
PreDepends: libattr1 (>= 2.4.41-1)
PreDepends: libc6 (>= 2.7)
PreDepends: libselinux1 (>= 1.32)
libacl1
Depends: libattr1 (>= 2.4.41-1)
Depends: libc6 (>= 2.4)
PreDepends: multiarch-support
libattr1
Depends: libc6 (>= 2.4)
PreDepends: multiarch-support
libc6
Depends: libc-bin (= 2.13-20ubuntu5)
Depends: libgcc1
Depends: tzdata
libc-bin
libgcc1
Depends: gcc-4.6-base (= 4.6.1-9ubuntu3)
Depends: libc6 (>= 2.2.5)
PreDepends: multiarch-support
gcc-4.6-base
multiarch-support
Depends: libc6 (>= 2.3.6-2)
tzdata
Depends: debconf (>= 0.5)
Depends: debconf-2.0
debconf
PreDepends: perl-base (>= 5.6.1-4)
perl-base
PreDepends: dpkg (>= 1.14.20)
PreDepends: libc6 (>= 2.11)
debconf-2.0
libselinux1
Depends: libc6 (>= 2.8)
PreDepends: multiarch-support
libbz2-1.0
Depends: libc6 (>= 2.4)
xz-utils
Depends: libc6 (>= 2.7)
Depends: liblzma2 (>= 5.0.0)
liblzma2
Depends: libc6 (>= 2.4)
zlib1g
Depends: libc6 (>= 2.4)
PreDepends: multiarch-support
install-info
Depends: libc6 (>= 2.4)
libssl1.0.0
Depends: debconf (>= 0.5)
Depends: debconf-2.0
Depends: libc6 (>= 2.7)
Depends: zlib1g (>= 1:1.1.4)
PreDepends: multiarch-support
falko@falko-virtual-machine:~$
对于大多数软件包,输出更长,可能不适合您的屏幕。 在这些情况下,您可以将输出管道输入更多
(或更少
),如下所示:
apt-rdepends apache2 | more
apt-rdepends apache2 | less
3链接
- Debian: http : //www.debian.org/
- Ubuntu: http : //www.ubuntu.com/