Cleanup Snaps

Snaps take a large amount of diskspace.


To check how much open a terminal and enter:

sudo du -sh /var/lib/snapd

To see all these snaos enter:

snap list --all

You can see the installed snaps and those that are disabled. If your system is in another language than English, take note of the word in your language.

To remove the disabled snaps make a shellscript:

nano clean-snap.sh

and entre this in the scropt:

#!/bin/bash

# Removes old revisions of snaps

# CLOSE ALL SNAPS BEFORE RUNNING THIS

set -eu

snap list --all | awk '/disabled/{print $1, $3}' |

while read snapname revision; do

snap remove "$snapname" --revision="$revision"

done

Now run the script with:

sudo bash clean-snap.sh

You ' ll see the packages that are removed. Check how much snaps are deleted using:

sudo du -sh /var/lib/snapd

The word "disabled" is language specific. You saw it earlier when you listed all your installed snaps

Use "uitgeschakeld" if your system is in Dutch an "désactivé" if your system is in French.