다음 스냅샷의 최신 버전만 유지하고 나머지는 삭제하여 공간을 확보할 수 있나요? 우분투 18.04.5 LTS를 사용하고 있습니다. 감사해요
wakatana@ubuntu:~$ snap list
Name Version Rev Tracking Publisher Notes
core 16-2.46.1 9993 latest/stable canonical✓ core
core18 20200724 1885 latest/stable canonical✓ base
gnome-3-26-1604 3.26.0.20200529 100 latest/stable/… canonical✓ -
gnome-3-28-1804 3.28.0-17-gde3d74c.de3d74c 128 latest/stable canonical✓ -
gnome-3-34-1804 0+git.3556cb3 60 latest/stable canonical✓ -
gnome-characters v3.34.0+git9.eeab5f2 570 latest/stable/… canonical✓ -
gnome-logs 3.34.0 100 latest/stable/… canonical✓ -
gnome-system-monitor 3.36.0-12-g35f88a56d7 148 latest/stable/… canonical✓ -
gtk-common-themes 0.1-36-gc75f853 1506 latest/stable/… canonical✓ -
wakatana@ubuntu:~$ du -hcs /var/lib/snapd/snaps/* | sort -h
4.0K /var/lib/snapd/snaps/partial
276K /var/lib/snapd/snaps/gnome-characters_550.snap
276K /var/lib/snapd/snaps/gnome-characters_570.snap
956K /var/lib/snapd/snaps/gnome-logs_100.snap
956K /var/lib/snapd/snaps/gnome-logs_93.snap
2.2M /var/lib/snapd/snaps/gnome-system-monitor_145.snap
2.2M /var/lib/snapd/snaps/gnome-system-monitor_148.snap
55M /var/lib/snapd/snaps/core18_1880.snap
55M /var/lib/snapd/snaps/gtk-common-themes_1502.snap
56M /var/lib/snapd/snaps/core18_1885.snap
63M /var/lib/snapd/snaps/gtk-common-themes_1506.snap
97M /var/lib/snapd/snaps/core_9804.snap
98M /var/lib/snapd/snaps/core_9993.snap
141M /var/lib/snapd/snaps/gnome-3-26-1604_100.snap
141M /var/lib/snapd/snaps/gnome-3-26-1604_98.snap
161M /var/lib/snapd/snaps/gnome-3-28-1804_116.snap
162M /var/lib/snapd/snaps/gnome-3-28-1804_128.snap
218M /var/lib/snapd/snaps/gnome-3-34-1804_60.snap
256M /var/lib/snapd/snaps/gnome-3-34-1804_36.snap
1.5G total
답변1
솔루션 1 -
$ snap set system refresh.retain=N
여기서 N은 2보다 작을 수 없습니다.
인용하다-
https://forum.snapcraft.io/t/configure-number-of-old-revisions-to-keep/2337/7
솔루션 2-
다음 스크립트는 비활성화된 모든 스냅샷을 삭제합니다.
새 버전으로 업그레이드한 후에는 이전 버전이 비활성화됩니다.
#!/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
인용하다 -https://www.linuxupising.com/2019/04/how-to-remove-old-snap-versions-to-free.html