Last active
June 2, 2022 08:51
-
-
Save AndreasGrip/cf66f3ac5493a15f06497d4d831eff25 to your computer and use it in GitHub Desktop.
Remove old unused versions of snap. To be used on AWS servers as lack of space can be a big problem as AWS snap crap chews up alot
This file contains 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/sh | |
set -eu | |
snap list --all | awk '/disabled/{print $1, $3}' | | |
while read snapname revision; do | |
#echo "$snapname" "$revision" | |
snap remove "$snapname" --revision="$revision" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment