列出套件的完整相依性清單

列出套件的完整相依性清單

我試圖列出安裝 Ruby 所必需的軟體包。例如,在 Archlinux 上:

$ pacman -Si ruby
Repository      : extra
Name            : ruby
Version         : 2.7.1-3
Description     : An object-oriented language for quick and easy programming
Architecture    : x86_64
URL             : https://www.ruby-lang.org/en/
Licenses        : BSD  custom
Groups          : None
Provides        : None
Depends On      : gdbm  openssl  libffi  libyaml  gmp  zlib  rubygems  ruby-irb
Optional Deps   : ruby-docs: Ruby documentation
                  tk: for Ruby/TK
Conflicts With  : None
Replaces        : None
Download Size   : 3.30 MiB
Installed Size  : 13.34 MiB
Packager        : Anatol Pomozov <[email protected]>
Build Date      : Sat 22 Aug 2020 03:46:33 IST
Validated By    : MD5 Sum  SHA-256 Sum  Signature

換句話說,Depends On : gdbm openssl libffi libyaml gmp zlib rubygems這就是我在 Ubuntu 中想要的。

在 Ubuntu 上,我嘗試這樣做:

$ apt-cache show ruby

輸出是:

Package: ruby
Architecture: amd64
Version: 1:2.5.1
Multi-Arch: allowed
Priority: optional
Section: interpreters
Source: ruby-defaults
Origin: Ubuntu
Maintainer: Ubuntu Developers <[email protected]>
Original-Maintainer: Antonio Terceiro <[email protected]>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 37
Provides: irb, rdoc, rubygems
Depends: ruby2.5
Suggests: ri, ruby-dev
Conflicts: ruby-activesupport-2.3, ruby-activesupport-3.2
Breaks: apt-listbugs (<< 0.1.6), rbenv (<= 0.4.0-1), ruby-debian (<< 0.3.8+b3), ruby-switch (<= 0.1.0)
Replaces: irb, rdoc, rubygems
Filename: pool/main/r/ruby-defaults/ruby_2.5.1_amd64.deb
Size: 5712
MD5sum: 4fbbfcf2431190a889f2430ffd017110
SHA1: 2b56994915b61fe6009613e0b879d9de16699206
SHA256: b01fd79a656f1e36542d1dd1046713ffb2d5f29902e433d06884333fcb151488
Homepage: http://www.ruby-lang.org/
Description-en: Interpreter of object-oriented scripting language Ruby (default version)
 Ruby is the interpreted scripting language for quick and easy
 object-oriented programming.  It has many features to process text
 files and to do system management tasks (as in perl).  It is simple,
 straight-forward, and extensible.
 .
 This package is a dependency package, which depends on Debian's default Ruby
 version (currently v2.5).
Description-md5: 9b1885fba57cb2974ce14902f85d3e27
Task: kubuntu-desktop, kubuntu-full
Supported: 5y

它沒有列出類似的包開放式SSL或者茲庫作為依賴。但當我嘗試清理時開放式SSL(這很危險,我只是運行命令並按 N 鍵跳過刪除),它還在刪除列表中列出了 ruby​​。這意味著 Ruby 依賴 OpenSSL。

我也遵循了類似的答案,其中列出了依賴 ruby​​ 的包,而不是 ruby​​ 依賴的包。

如果你問為什麼那麼重要,原因是我正在寫一個指南,如何使用各種 optflags (CFLAGS) 編譯 Ruby 以提高效能,主要針對 Arch。然後我也想添加 Ubuntu,但我沒有獲得建立 Ruby 所需的完整依賴項清單。我無法列出 arch 軟體包,因為 Ubuntu 有一些不同且奇怪的名稱。比如調用base-develasbuild-essential等。

那麼列出包的方法是什麼呢?

答案1

apt-rdepends從同名包中使用:

$ apt-rdepends ruby
ruby
  Depends: ruby2.7
ruby2.7
  Depends: libc6 (>= 2.4)
  Depends: libruby2.7 (>= 2.7.0~preview1)
  Depends: rubygems-integration (>= 1.8)
libc6
  Depends: libcrypt1
  Depends: libgcc-s1
libcrypt1
  Depends: libc6 (>= 2.25)
libgcc-s1
  Depends: gcc-10-base (= 10.2.0-6)
  Depends: libc6 (>= 2.14)
gcc-10-base
...
ca-certificates
  Depends: debconf (>= 0.5)
  Depends: debconf-2.0
  Depends: openssl (>= 1.1.1)
openssl
  Depends: libc6 (>= 2.15)
  Depends: libssl3 (>= 3.0.0~~alpha1)
libssl3
  Depends: debconf (>= 0.5)
  Depends: debconf-2.0
  Depends: libc6 (>= 2.25)

既然你有興趣大樓包,您可能需要該-b選項將遞歸地列出包的建置依賴項。

相關內容