Space used by the VLC snap

It is normal that the VLC snap takes care of me:

du -hs /snap/vlc
2,3G /snap/vlc

mount | grep vlc
/var/lib/snapd/snaps/vlc_555.snap on /snap/vlc/555 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/vlc_365.snap on /snap/vlc/365 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/vlc_190.snap on /snap/vlc/190 type squashfs (ro,nodev,relatime,x-gdu.hide)

As I understand it, snap creates copies when updating the application, but is not there an automatic mechanism to keep only 2 versions?
In this case, I’m afraid that space will increase with time.

you are measuring the wrong thing here (the mounted squashfs’es do only present you the uncompressed content of the squashfs, this is not the actual size that is occupied on disk)

to see the actual size of the snap packages themselves something like:

$ du -hcs /var/lib/snapd/snaps/vlc_5*
196M	/var/lib/snapd/snaps/vlc_555.snap
196M	/var/lib/snapd/snaps/vlc_583.snap
196M	/var/lib/snapd/snaps/vlc_585.snap
587M	total
$

…gives you the real value

indeed there is additionally also cached data and such which the app creates at runtime. you might want to measure this too:

$ du -hcs /var/snap/vlc
20K	/var/snap/vlc
20K	total
$ du -hcs ~/snap/vlc
19M	/home/ogra/snap/vlc
19M	total

there have been discussions to make the 3-snap paradigm configurable, i’m not sure where on the core teams TODO list that stands currently. but as you can see above it would save you far less in reality (196M vs 770M)…

1 Like

Yes, with that command it actually occupies:

du -hcs /var/lib/snapd/snaps/vlc_5*
196M /var/lib/snapd/snaps/vlc_555.snap
196M totale

But I referred to the documentation:
https://forum.snapcraft.io/t/the-snap-directory/2817

and that documentation says exactly:

However, these files and folders are mounted from the heavily compressed data that’s stored within the original snap, located in /var/lib/snapd/snaps. These snaps take far less space on your system than their mount points imply

which is pretty much the same i said above :slight_smile: do not measure the content of the mount points but the snap files to get a realistic view of the actual disk usage.

2 Likes

Sorry, you’re right, I have not been very careful reading, next time I’ll pay more attention.

1 Like