Skip to content

Instantly share code, notes, and snippets.

@kokoye2007
Created August 4, 2019 10:35
Show Gist options
  • Save kokoye2007/13e8befc1590f0b245781a826d5fda74 to your computer and use it in GitHub Desktop.
Save kokoye2007/13e8befc1590f0b245781a826d5fda74 to your computer and use it in GitHub Desktop.
Sanp Old Version Remove
#!/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