From bc1b20a0aaacb6fb49d5ee810904335f98743280 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20Fernando=20S=C3=A1nchez?= Date: Tue, 6 Sep 2022 12:59:56 +0200 Subject: [PATCH] script to remove old snap packages --- scripts/.bin/remove-old-snaps.sh | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 scripts/.bin/remove-old-snaps.sh diff --git a/scripts/.bin/remove-old-snaps.sh b/scripts/.bin/remove-old-snaps.sh new file mode 100644 index 0000000..e1516a1 --- /dev/null +++ b/scripts/.bin/remove-old-snaps.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# Removes old revisions of snaps +# CLOSE ALL SNAPS BEFORE RUNNING THIS +set -eu + +LANG=C snap list --all | awk '/disabled/{print $1, $3}' | + while read snapname revision; do + snap remove "$snapname" --revision="$revision" + done