Created
May 17, 2021 11:35
-
-
Save sidneyspe/932b44dfa994be311bfb1eb5c9001a6d to your computer and use it in GitHub Desktop.
Script for remove old versions of installed snaps
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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