Skip to content

Instantly share code, notes, and snippets.

@naranyala
Created October 23, 2023 12:39
Show Gist options
  • Save naranyala/5a72de08842588f696ec8a66f43cc0c7 to your computer and use it in GitHub Desktop.
Save naranyala/5a72de08842588f696ec8a66f43cc0c7 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Removes old revisions of snaps
# CLOSE ALL SNAPS BEFORE RUNNING THIS
set -eu
LANG=C 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