代码: 全选
#!/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
如果空间没有释放,可以删除/var/lib/snapd/cache/*
代码: 全选
rm /var/lib/snapd/cache/*