4

I know I can get a package's reverse dependency list with

apt-cache rdepends <pkg>

However, this shows dependencies on the system I run it on.

How could I find out dependent packages for a different distro (e.g. an old Debian Wheezy/Jessie) without installing it somewhere?

2 Answers 2

4

You can give apt-cache extra package sources after downloading them, and get it to ignore the installed package sources; for example for Jessie amd64:

wget http://archive.debian.org/debian/dists/jessie/main/binary-amd64/Packages.xz
printf "" > /tmp/status
apt-cache -p /tmp/pkgcache -s /tmp/srccache -o Dir::State::Lists=/tmp -o Dir::State::Status=/tmp/status --with-source Packages.xz rdepends libevdev2

The various /tmp-based options instruct apt-cache to look for metadata files in /tmp; it won’t find any there, apart from the status file (or, at least, it shouldn’t — use another directory if necessary), so it will only use the information in the given Packages.xz file.

2
  • I believe unix.stackexchange.com/a/60557 would be a valid approach as well.
    – Quasímodo
    Dec 1, 2020 at 13:39
  • @Quasímodo that involves changing the running system’s configuration, which I’d rather avoid unless really necessary, and it lists reverse dependencies outside the chosen release (for example on a Debian 10 system, with Jessie, it will list libinput5 and libinput10 as reverse dependencies of libevdev2). Dec 1, 2020 at 13:45
1

apt-rdepends --reverse (recursive reverse depends) also works:

wget http://archive.debian.org/debian/dists/jessie/main/binary-amd64/Packages.xz
touch /tmp/status
apt-rdepends -o Dir::Cache::pkgcache=/tmp/pkgcache -o Dir::Cache::srcpkgcache=/tmp/srccache -o Dir::State::Lists=/tmp -o Dir::State::Status=/tmp/status -o APT::Sources::With=Packages.xz --reverse libevdev2
1
  • It’s IMO better to empty /tmp/status instead of touching it, just to ensure that there’s nothing there that might mess things up. Feb 12, 2021 at 12:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .