3

If I get it right, then snap installs the application package which contains a binary and the libraries the application depends on, if they're not installed already.

But I wonder how I can view these libraries the application depends on like I can do with apt depends <application> in apt.

J.Doe
  • 33

3 Answers3

2

As far as I can tell, the closest you can get is via

snap connections

It will list the connections that various snaps provide and have to each other and the system.

Kudos to this answer for pointing me in the right direction.

antichris
  • 205
1

tl;dr: there's no such thing, because snaps don't have dependencies.

Snaps don't install dependencies if they're not already installed. They literally bundle them along with the rest of the snap. For example, if you have PHP 7.1 installed as a Debian package, and you install the Nextcloud snap, the Nextcloud snap will be using PHP 7.3 because it includes it inside the snap. In fact, it's confined to the point of not even being able to find out if you have PHP already installed or not, much less have the ability to install more stuff on your host.

Why do they work this way? One of the reasons is so that snap developers can rest assured that you're using exactly what they tested. To re-use the Nextcloud snap example, those maintainers can rest a lot easier releasing updates knowing that it's impossible for any of their users to be using anything other than PHP 7.3. If they had to make sure they tested it against every possible PHP version, releases would be a lot slower and a lot more risky.

Now, time for a little caveat. While snaps don't have traditional dependencies, it's possible for snaps to share content between each other using a special content interface. In that sense it's possible to create snap A that doesn't work properly unless a snap that's providing the content it requires is also installed. However, that doesn't imply that snap A depends on snap B, it implies that snap A depends on something providing it with a particular set of content; that might be snap B, but could also be snap C. For the most part, you can completely ignore this caveat and say "snaps bundle their dependencies."

kyrofa
  • 7,346
  • 1
  • 32
  • 26
-1

The objective of Snaps is to hide that from you.

However, you can look up the pre-Snap package which is the equivalent for the app and find your dependencies that way by opening a browser and going to "ubuntu man ".

K7AAY
  • 17,202
  • Snaps don't (and aren't trying to ) hide anything, they just don't have that kind of dependency. – kyrofa Mar 04 '20 at 22:10