Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# https://superuser.com/questions/1310825/how-to-remove-old-version-of-installed-snaps/1330590#1330590
# https://www.linuxuprising.com/2019/04/how-to-remove-old-snap-versions-to-free.html
#!/bin/bash
# Removes old revisions of snaps
# CLOSE ALL SNAPS BEFORE RUNNING THIS
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment