Skip to content

Instantly share code, notes, and snippets.

@RobbiNespu
Created July 30, 2021 02:52
Show Gist options
  • Save RobbiNespu/0d4a2f4b7e45213a2ecd8a018461c771 to your computer and use it in GitHub Desktop.
Save RobbiNespu/0d4a2f4b7e45213a2ecd8a018461c771 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=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