Skip to content

Instantly share code, notes, and snippets.

@culy247
Created August 11, 2022 06:46
Show Gist options
  • Save culy247/c842ec30c7c86de5e65912f773aec8e1 to your computer and use it in GitHub Desktop.
Save culy247/c842ec30c7c86de5e65912f773aec8e1 to your computer and use it in GitHub Desktop.
Remove snap old revisions
#!/bin/bash
# Removes old revisions of snaps
# CLOSE ALL SNAPS BEFORE RUNNING THIS
set -eu
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