0

To know which packages depend on a specific package, I can run:

$ apt rdepends <package>

example:

$ apt rdepends netcat-openbsd
netcat-openbsd
Reverse Depends:
  Recommends: libvirt-daemon
  Recommends: libvirt-daemon
  Depends: xletters
  Depends: tomcat10-user
 |Depends: rtpengine-utils
  Suggests: mariadb-server
 |Depends: ifupdown-extra
  Depends: freedombox
  Depends: ubuntu-minimal

Snap packages don't typically have as many dependencies outside of core/gnome, but this is still wanted in some cases.

For example, if I have multiple snap core packages, it isn't obvious how to identify which snaps depend on a specific version of core.

Name                       Version          Rev    Tracking         Publisher   Notes
...
core18                     20240416               2823   latest/stable       canonical✓         base
core20                     20240416               2318   latest/stable       canonical✓         base
core22                     20240408               1380   latest/stable       canonical✓         base
...

While specific example has already been answered[1] elsewhere, it isn't a generic solution. Answering this question for snaps which depend on gnome and gtk themes are not answered in that question.

[1] Expecting the user to understand the snap configuration file and read these files on disk makes this feel like an afterthought to snap's user interface.

  • 1
    See the above answer - especially the command: grep "base:" /snap/*/*/meta/snap.yaml – Artur Meinild May 16 '24 at 09:04
  • @ArturMeinild Similar, but doesn't answer my question. I will clarify what I am asking. – Brett Holman May 16 '24 at 09:10
  • You asked about which version of core each snap is dependent on, and that command will show exactly that. – Artur Meinild May 16 '24 at 09:10
  • @ArturMeinild I clarified my question – Brett Holman May 16 '24 at 09:24
  • "Answering this question for snaps which depend on gnome and gtk themes are not answered in that question." That is EXACTLY answered as well, since this is showed by: grep "default-provider:" /snap/*/*/meta/snap.yaml – Artur Meinild May 16 '24 at 09:36
  • So by combining the two results searching for base and default-provider will give you the info you need. And no, it's not very pretty, and yes it's an afterthought, but it's what is possible. You can make your own script to make it more pretty. This would be an excellent opportunity to delve into bash scripting. – Artur Meinild May 16 '24 at 09:37
  • @ArturMeinild That is EXACTLY answered as well, since this is showed by. Is that what default-provider means? The question doesn't clarify what that term means. Also, Google search results on this term don't point to anything that resembles useful documentation on what it is. – Brett Holman May 16 '24 at 09:52
  • Yes default-provider shows the other dependencies which are not base. I thought that is pretty obvious from the very detailed answer. In any case, I believe it will show everything you need for your question to be answered. – Artur Meinild May 16 '24 at 09:54
  • Reference: https://snapcraft.io/docs/content-interface#heading--default – Artur Meinild May 16 '24 at 09:58
  • @ArturMeinild I thought that is pretty obvious from the very detailed answer It's obvious to you but not me. Snap terminology is foreign to me and doesn't appear well-defined. That answer says may help us to know which "supporting" snaps are needed:. What is a "supporting snap"? Is this some build dependency for people who build snaps locally? Is a supporting snap one which is a test dependency for those that run snaps? Is it an optional dependency which allows additional functionality if it is provided? In deb/dpkg packaging, these are different. – Brett Holman May 16 '24 at 10:04
  • 2
    A supporting snap as mentioned in that answer is a dependency, yes. I'll try and edit the answer in a non-destructive way to make it a bit more clear.. – Artur Meinild May 16 '24 at 10:06
  • @ArturMeinild Regarding that reference: The optional default-provider attribute can be used to set to the name of a snap offering a corresponding content slot. From this it is pretty unclear how this group of words is supposed to mean "this is a dependency". Also, searching for the phrase "content slot" got me nowhere, but after a bunch of visual parsing the snapcraft page search results eventually got me to the page which describes this architecture. – Brett Holman May 16 '24 at 10:14

0 Answers0