我正在使用 Ubuntu 20.04 LTS。
我的 snapd 服务不可用:
$ systemctl status snapd.service
● snapd.service - Snap Daemon
Loaded: loaded (/lib/systemd/system/snapd.service; enabled; vendor preset: enabled)
Active: deactivating (stop-sigterm) (Result: timeout)
TriggeredBy: ● snapd.socket
Main PID: 29952 (snapd)
Tasks: 10 (limit: 8186)
Memory: 12.8M
CGroup: /system.slice/snapd.service
└─29952 /usr/lib/snapd/snapd
Oct 27 00:47:07 seb-C70D-B-311 systemd[1]: Starting Snap Daemon...
Oct 27 00:47:07 seb-C70D-B-311 snapd[29952]: AppArmor status: apparmor is enabled and all features are available
Oct 27 00:47:07 seb-C70D-B-311 snapd[29952]: AppArmor status: apparmor is enabled and all features are available
Oct 27 00:48:37 seb-C70D-B-311 systemd[1]: snapd.service: start operation timed out. Terminating.
$ time snap version
snap 2.52.1
snapd unavailable
series -
real 0m25.075s
user 0m0.036s
sys 0m0.060s
我的/var/lib/snapd
文件系统已满:
$ df -PTh /var/lib/snapd
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/VG_Samsung_SSD_860_EVO_1TB__S3Z9NB0K4019-LV_var_lib_snapd ext4 4.9G 4.9G 0 100% /var/lib/snapd
$ ls -lh /var/lib/snapd/snaps
total 4.0G
-rw------- 1 root root 68K Sep 10 23:08 acrordrdc_53.snap
-rw------- 1 root root 68K Sep 20 13:03 acrordrdc_62.snap
-rw------- 2 root root 4.0K Sep 26 12:44 bare_5.snap
-rw------- 1 root root 146M Oct 10 21:58 chromium_1781.snap
-rw------- 2 root root 145M Oct 23 12:29 chromium_1801.snap
-rw------- 1 root root 56M Jun 23 18:57 core18_2074.snap
-rw------- 1 root root 56M Aug 15 17:45 core18_2128.snap
-rw------- 1 root root 62M Jul 24 10:15 core20_1081.snap
-rw------- 1 root root 62M Oct 8 22:05 core20_1169.snap
-rw------- 1 root root 100M Oct 15 11:18 core_11798.snap
-rw------- 1 root root 100M Oct 21 12:26 core_11993.snap
-rw------- 2 root root 163M Dec 19 2020 gnome-3-28-1804_145.snap
-rw------- 1 root root 165M Jul 8 16:18 gnome-3-28-1804_161.snap
-rw------- 1 root root 219M Jan 9 2021 gnome-3-34-1804_66.snap
-rw------- 1 root root 219M Jun 14 14:23 gnome-3-34-1804_72.snap
-rw------- 1 root root 66M Apr 22 2021 gtk-common-themes_1515.snap
-rw------- 1 root root 66M Sep 26 12:44 gtk-common-themes_1519.snap
-rw------- 2 root root 140K Aug 23 2020 gtk2-common-themes_13.snap
drwxr-xr-x 2 root root 4.0K Jul 10 2020 partial/
-rw------- 1 root root 33M Oct 13 20:06 snapd_13270.snap
-rw------- 1 root root 33M Oct 20 21:14 snapd_13640.snap
-rw------- 1 root root 136M Aug 23 00:17 whatsapp-for-linux_26.snap
-rw------- 1 root root 112M Oct 18 15:58 whatsapp-for-linux_27.snap
-rw------- 2 root root 304M Feb 6 2021 wine-platform-5-stable_16.snap
-rw------- 1 root root 304M Sep 26 12:44 wine-platform-5-stable_18.snap
-rw------- 2 root root 323M Sep 20 13:03 wine-platform-6-stable_8.snap
-rw------- 1 root root 347M Oct 8 22:05 wine-platform-runtime_250.snap
-rw------- 1 root root 347M Oct 15 11:19 wine-platform-runtime_251.snap
-rw------- 1 root root 347M Oct 23 12:29 wine-platform-runtime_252.snap
-rw------- 1 root root 164M Oct 26 22:50 wine-platform-runtime_252.snap.partial
/var/lib/snapd
当 snapd 不可用时,如何正确释放文件系统上的空间?
EDIT0:无法snapd
成功启动服务,可能是因为我的/var/lib/snapd
文件系统已满。
您可以删除所有未使用的快照包版本。您可以创建脚本文件并使其可执行,或者只是将其复制并粘贴到控制台中。
请注意,您需要
sudo
权限。如果
snap remove
由于服务器未运行而导致命令不起作用snapd
,则应手动释放一些空间。您可以删除旧版本的 snap 包文件。例如,用户有两个 Chromium 快照,
chromium_1781.snap
并且chromium_1801.snap
. 只需使用以下命令手动删除旧版本:并尝试运行该
snapd
服务。您还可以通过以下命令清理文件日志以获取可用空间:
跑
清除缓存,这应该会给你一些可用空间。