remove_old_revisions_of_snaps.sh 356 B

123456789101112
  1. #!/usr/bin/env bash
  2. # Removes old revisions of snaps
  3. # CLOSE ALL SNAPS BEFORE RUNNING THIS
  4. set -eu
  5. # LANG=C snap list --all | awk '/disabled/{print $1, $3}' |
  6. snap list --all | awk '/disabled/{print $1, $3}' |
  7. while read snapname revision; do
  8. snap remove "$snapname" --revision="$revision"
  9. done
  10. notify-send -i dialog-information "Removed"