发行版:Ubuntu 21.04 (Hirsute Hippo)
我多次删除了 snapd(显然删除了 snapd),然后在安装 snapd 后,所有 snap 都正常了。这次我重新安装了 AppArmor 并安装了 snapd,启用并运行,但这次没有安装 snap。
The following packages will be REMOVED:
apparmor* apparmor-easyprof* apparmor-notify* apparmor-profiles* apparmor-profiles-extra* apparmor-utils* snapd*
root@zika:/etc# systemctl status snapd
● snapd.service - Snap Daemon
Loaded: loaded (/lib/systemd/system/snapd.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2021-08-30 19:49:42 EDT; 50min ago
TriggeredBy: ● snapd.socket
Main PID: 1147 (snapd)
Tasks: 10 (limit: 4450)
Memory: 24.3M
CGroup: /system.slice/snapd.service
└─1147 /usr/lib/snapd/snapd
Aug 30 19:49:29 zika systemd[1]: Starting Snap Daemon...
Aug 30 19:49:39 zika snapd[1147]: AppArmor status: apparmor is enabled and all features are available
Aug 30 19:49:40 zika snapd[1147]: daemon.go:347: started snapd/2.49.2+21.04ubuntu1 (series 16; classic) ubuntu/21.04 (amd64) linux/5.11>
Aug 30 19:49:41 zika snapd[1147]: daemon.go:440: adjusting startup timeout by 30s (pessimistic estimate of 30s plus 5s per snap)
Aug 30 19:49:42 zika systemd[1]: Started Snap Daemon.
lines 1-15/15 (END)
root@zika:/etc# systemctl status snapd.socket
● snapd.socket - Socket activation for snappy daemon
Loaded: loaded (/lib/systemd/system/snapd.socket; enabled; vendor preset: enabled)
Active: active (running) since Mon 2021-08-30 19:49:28 EDT; 47min ago
Triggers: ● snapd.service
Listen: /run/snapd.socket (Stream)
/run/snapd-snap.socket (Stream)
Tasks: 0 (limit: 4450)
Memory: 0B
CGroup: /system.slice/snapd.socket
Aug 30 19:49:28 zika systemd[1]: Starting Socket activation for snappy daemon.
Aug 30 19:49:28 zika systemd[1]: Listening on Socket activation for snappy daemon.
root@zika:/etc# systemctl --state=running|g snap
snapd.service loaded active running Snap Daemon
snapd.socket loaded active running Socket activation for snappy daemon
snap 列表
未安装 snap
和 lsblk:
root@zika:/etc# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 698.6G 0 disk
├─sda1 8:1 0 279.5G 0 part /
├─sda2 8:2 0 450M 0 part
├─sda3 8:3 0 100M 0 part
├─sda4 8:4 0 16M 0 part
├─sda5 8:5 0 98.4G 0 part
├─sda6 8:6 0 666M 0 part
├─sda7 8:7 0 217.8G 0 part /mnt/a38b81ea-8929-4863-a582-c5b65ed6738f
├─sda8 8:8 0 5.4G 0 part [SWAP]
├─sda9 8:9 0 243M 0 part
└─sda10 8:10 0 96.1G 0 part
sr0 11:0 1 1024M 0 rom
我仍然有 /home/user/snap,但 /var/lib/snapd/snaps 是空的。这是恢复快照的方法吗?还是只是丢失了?/home/user/snap 是干什么用的?我假设再次安装丢失的快照将保留 /home/user/snap 的配置。我真的对此感到困惑,有人能解释一下吗?谢谢!
答案1
删除snapd
还会删除所有已安装的 snap 和系统目录中安装的所有文件(至少,目前是这样)。因此,在重新安装 snap 后,您需要重新安装所有 snap。
用户配置数据永远不会被自动删除。您主目录中“snap”目录中的所有用户配置数据都将保留 - 如果您再次安装,则相应的 snap 可以使用这些数据。