Vinod Kurup

Hospitalist/programmer in search of the meaning of life

Dec 9, 2020 - 1 minute read - Comments - cheatsheet ubuntu linux

Deleting old snaps

Copy this script into ~/bin/:

#!/bin/bash
# Removes old revisions of snaps
# CLOSE ALL SNAPS BEFORE RUNNING THIS
set -ex

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

Found on https://www.linuxuprising.com/2019/04/how-to-remove-old-snap-versions-to-free.html and slightly edited.

Using an OBi110 for VOIP service Disk Space Hogs

comments powered by Disqus