Skip to content

Instantly share code, notes, and snippets.

@anomixer
Forked from Vchekryzhov/remove-snaps.sh
Created May 17, 2024 09:21
Show Gist options
  • Save anomixer/295f589172322cb4ce60a66b15d6bcbb to your computer and use it in GitHub Desktop.
Save anomixer/295f589172322cb4ce60a66b15d6bcbb to your computer and use it in GitHub Desktop.
remove snaps
#!/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