Skip to content

Instantly share code, notes, and snippets.

@stefanbirkner
Created April 2, 2021 15:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stefanbirkner/ed2c0f7887c3254c140b14ad79d03cd9 to your computer and use it in GitHub Desktop.
Save stefanbirkner/ed2c0f7887c3254c140b14ad79d03cd9 to your computer and use it in GitHub Desktop.
Removes old revisions of snaps
#!/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