Skip to content

Instantly share code, notes, and snippets.

@cpxPratik
Last active May 16, 2022 03:42
Show Gist options
  • Save cpxPratik/4840746e015a05dc0cca54b6a2ffd683 to your computer and use it in GitHub Desktop.
Save cpxPratik/4840746e015a05dc0cca54b6a2ffd683 to your computer and use it in GitHub Desktop.
Clean up older snap packages https://itsfoss.com/clean-snap-packages/
#!/bin/bash
# Removes old revisions of snaps
# CLOSE ALL SNAPS BEFORE RUNNING THIS
set -eu
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