2013-05-03 41 views
2

我在哪裏可以找到大多數流行Linux軟件包的所有依賴項(直接和傳遞依賴項)?Linux軟件包在哪裏可以下載完整的依賴列表

我想要一個完整的列表(只是列表)的依賴關係圖的形式,供探索。是否有可下載的最受歡迎的Linux軟件包依賴關係列表?

有一些脫機DVD的安裝(如Debian/Ubuntu等)。 是否有任何工具可以提取這些DVD中給定軟件包的相關性信息?

我已經看到下面的問題,但這不是我想要的。 Howto list all dependencies of a Package on Linux?

日Thnx

+0

爲什麼鏈接的問題不是你想要的? – 2013-05-03 08:12:14

回答

1

debianubuntu可以發出

apt-cache show $PACKAGE_NAME 

您開始使用打印的所有包依賴關係的列表:

for pkg in $(dpkg --get-selections | cut -f1) ; do apt-cache depends "$pkg" ; done 
+0

您可以使用'dpkg --get-selections'來獲取軟件包列表。 – 2013-05-03 08:57:06

+0

@BasileStarynkevitch感謝您的評論。增加了一行;) – hek2mgl 2013-05-03 09:09:22

+0

非常感謝。非常好的代碼。 – 2013-05-03 10:37:40

3

既然你不想瀏覽Ubuntu's package page,我做了一個小腳本來保存所有的軟件包名稱和依賴於文本文件。不用說,運行需要一段時間。

Download the script或見下文來源:

#!/bin/bash 
#author: @mrmitche_ 
#name: Build Dependencies List 
#description: Lists the dependencies of all packages in apt on linux. 

packages=$(apt-cache pkgnames) 
declare -a array=($packages) 

for pkg in ${array[@]} 
do 
    apt-cache depends $pkg >>dependencies.txt 
    printf "\n" >>dependencies.txt 
done 

樣品輸出dependencies.txt:

postgresql-plperl-9.0 
    Depends: libc6 
    Depends: libperl5.14 
    Depends: postgresql-9.0 
    Depends: perl 
    Replaces: postgresql-contrib-9.0 
    Replaces: postgresql-contrib-9.0:i386 
    Conflicts: postgresql-plperl-9.0:i386 

libc6-xen:i386 
    PreDepends: libc6:i386 

python-pkginfo-doc 
    Depends: libjs-sphinxdoc 

mumudvb 
    Depends: adduser 
    Depends: dvb-apps 
    Depends: libc6 
    Suggests: dvbtune 
    Conflicts: mumudvb:i386 

libuuidm-ocaml-dev 
    Depends: <ocaml-nox-3.12.1> 
    ocaml-nox 
    Depends: libc6 
    Suggests: ocaml-findlib 
    Conflicts: libuuidm-ocaml-dev:i386 

你可以修改腳本以格式化你喜歡的。也許源碼包,以便他們按字母順序排列。

相關問題