Skip to content

Instantly share code, notes, and snippets.

@dazeb
Created May 23, 2023 20:17
Show Gist options
  • Select an option

  • Save dazeb/1ed0ddc8f3ead2be4f0044d829b05bb9 to your computer and use it in GitHub Desktop.

Select an option

Save dazeb/1ed0ddc8f3ead2be4f0044d829b05bb9 to your computer and use it in GitHub Desktop.
Remove old snaps Ubuntu 22.04
#!/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