Very Snappy problem

I just checked my SSD as I was cleaning it up to get more space and I saw that snap had installed multiple version of the same software... 3 times!

I understand that snap keep the older version in case of a problem like it's explained here:

But I am not interested by that, I want to remove older versions of these apps... ALL of them and only keep the latest version.

how can I do it? any idea?

To see what I mean check out the screenshot, for example, starruler2 when I list via terminal it does not show the older version but on the file system, I can clearly see that all these snaps are taking a lot too much space.

Imagine if you got 20 snaps of 1GB each after updates they will take 60GB instead of 20GB :open_mouth:

Check out the following pages @Patrice -

1 Like

Wooww THANKS a lot @mdooley :hugs:

I tried all that was written none of them worked straight out of the box but I transformed the one with a single line in the terminal, and terminal proposed me to use sudo which i have put after "then" (to remove)
and it worked just fine :clap:
For those who want it also It's below :wink:

snap list --all | while read snapname ver rev trk pub notes; do if [[ $notes = *disabled* ]]; then sudo snap remove "$snapname" --revision="$rev"; fi; done

1 Like

That's what I like, a thorough report back! Thanks Patrice!

1 Like

It was all my pleasure.

Just a quick note for people that don't use English in their systems: you need to translate the word "disabled". I use "desactivado" in Spanish. Just run the command "snap list --all" to see how your system mark the older versions.
Another option is to add something like export LC_ALL=C to the script to force English responses.

3 Likes