Skip to content

Instantly share code, notes, and snippets.

@Shubhayu-Das
Created January 8, 2022 09:42
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 Shubhayu-Das/c4765a4673a92ddc551a7a56f6d86aeb to your computer and use it in GitHub Desktop.
Save Shubhayu-Das/c4765a4673a92ddc551a7a56f6d86aeb to your computer and use it in GitHub Desktop.
Script to remove files for older versions of installed 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