Skip to content

Instantly share code, notes, and snippets.

@thiagozs
Created March 8, 2019 14:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thiagozs/09a02408b26ad4f7c89575b7daae6fee to your computer and use it in GitHub Desktop.
Save thiagozs/09a02408b26ad4f7c89575b7daae6fee to your computer and use it in GitHub Desktop.
Clear Snap old versions
#!/bin/bash
# Removes old revisions of snaps
# CLOSE ALL SNAPS BEFORE RUNNING THIS
set -eu
sudo snap list --all | awk '/disabled/{print $1, $3}' |
while read snapname revision; do
sudo snap remove "$snapname" --revision="$revision"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment