List the full dependency list of a package

Sourav Goswami

I am trying to list the packages that are essential to install Ruby. For example, on 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

In other words, Depends On : gdbm openssl libffi libyaml gmp zlib rubygems is what I want in Ubuntu.

On Ubuntu, I am trying to do this:

$ apt-cache show ruby

The output is:

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

It doesn't list packages like openssl or zlib as dependency. But when I try to purge openssl (this is dangerous, and I just ran the command and pressed the N key to skip removal), it also lists ruby in the removal list. That means Ruby depends on OpenSSL.

I have also followed answers like this, which lists the packages that depends on ruby, not the packages ruby depends on.

If you ask why is that important, the reason is I am writing a guide how to compile Ruby with various optflags (CFLAGS) for performance, mainly for Arch. Then wanted to add Ubuntu as well, and I didn't get a complete dependency list which is required to build Ruby. I can't list the arch packages, because Ubuntu has some different and weird names. Like calling base-devel as build-essential, etc.

So what's the way to list packages?

Stephen Kitt

Use apt-rdepends from the eponymous package:

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

Since you’re interested in building the package, you might need the -b option which will recursively list the package’s build-dependencies.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related