📅  最后修改于: 2022-03-11 14:50:53.537000             🧑  作者: Mango
# make a file with name whatever.sh
# where contain botton script
# then run sudo bash whatever.sh
#!/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