Comment 5 for bug 1657104

Revision history for this message
AdlerHorst (adlerhorst) wrote (last edit ):

Since Snap I have much problem with diskspace. I permanently get diskspace warnings It seems that Snap-apps I have, using around 50% of my Root disk space. It would be much easier If I could permanently deactivate or limit the backup of old SNAP versions to certain Apps.
e.g. 'sudo snap set system refresh.retain=0'

For the record cleaning old snap is only a temporary solution.

#!/bin/bash
# Removes old revisions of snaps
set -eu

LANG=en_US.UTF-8 snap list --all | awk '/disabled/{print $1, $3}' |
    while read snapname revision; do
        snap remove "$snapname" --revision="$revision"
    done

I would vote for a solution which autoremove oldest SNAP if free Diskspace is lower than double the disk-space warning.