2

Consider apt search util-linux. This shows me that the package util-linux/bionic-updates,bionic-security,now 2.31.1-0.4ubuntu3.7 amd64 [installed] is available. Additionally, I have worked out that I can do dpkg -s util-linux and it tells me: "Description: miscellaneous system utilities: This package contains a number of important utilities, most of which are oriented towards maintenance of your system. Some of the more important utilities included in this package allow you to view kernel messages, create new filesystems, view block device information, interface with real time clock, etc."

Before I install a package, I want to find out:

• What size is this package (both download and extracted sizes - I guess I can get that from an apt install 'name' and then aborting the install as that information is shown)?

• What additional libraries will this package require, and what size are they (download and extracted sizes)?

• What executable binaries are in this package and what paths will they be placed in if I install this package?

• What additional non-executable files are in this package (e.g. configuration files etc) and what paths will they be placed in if I install this package?

• For the situation after install, given a command like git, how can I also find what package that file originally came from?

• Finally, how can I do all of the above also for snap and flatpak packages?

3

snap info snapname will tell you the size, but won't tell you if it needs any "content" (sometimes called "platform") snaps (like gnome-3-34-1804) or bases (like core20). You may already have them installed, but equally may not.

Snaps have libraries bundled (other than those that exist in the base and any platform snaps used), so there isn't really a concept of dependencies / libraries being pulled in aside from the content/base snaps.

You can however snap download snapname to grab it, then unsquash -l snapfilename to list what's in it. You can also fully unpack it with unsquash snapfilename to get a good idea of what's inside.

Snaps also (sometimes*) contain a manifest which details what's in it. Once the snap is downloaded you can unsquashfs snapfilename snap/manifest.yaml and peer into that to see which libraries were included in the snap. You can also (sometimes*) pull out the original snapcraft.yaml which was used to build it, using the same method: unsquashfs snapfilename snap/snapcraft.yaml.

* The "sometimes" is because it depends how a snap is built. They're not all built the same way.

  • Very informative and useful, I have not seen any of this before. 👍 – YorSubs Dec 5 '20 at 16:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.