Skip to content

Instantly share code, notes, and snippets.

@Jan-Zeiseweis
Created September 23, 2021 08:45
Show Gist options
  • Save Jan-Zeiseweis/83b4dc4cf0dcb8d7e3c443a7b09f0692 to your computer and use it in GitHub Desktop.
Save Jan-Zeiseweis/83b4dc4cf0dcb8d7e3c443a7b09f0692 to your computer and use it in GitHub Desktop.
Removes outdated snaps.
#!/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 -r 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