我认为我在 root 和 home 中的 snap 文件夹被交换了。确实,根据这个帖子的回答,我的snap的所有配置文件都应该在snap文件夹中,/home
而.snap文件夹中应该只有挂载点/root
。然而,它似乎是相反的(root 中使用 18GB 内存, 中使用 1.3GB 内存/home
):
Q1:如何交换这两个文件夹?(我想简单地移动它们是行不通的)
Q2:我也有一个文件夹snapd
中/var/lib
是7GB。这是正常的吗?
Q3:我注意到每个快照都存储了两个版本:我可以安全地删除旧版本以节省空间吗?
infos: Ubuntu 20.04, Dell XPS 15
Indeed, according to the answer of this post, all the configuration files of my snaps should be in the snap folder stored in home while there should only be mount points in the one stored in root. However, it seems to be the other way round [...].
This point is correct, but you're neglecting the fact that du
doesn't care that something is mounted there. You asked it to tell you how big the files are in a specific location, and it told you. Check the output of the mount
command and you'll notice that nearly everything in the /snap
directory is just a mount point. Everything else in there is just a symlink. What you're seeing is correct, don't worry! You don't want to swap anything.
Q2: I also have a folder snapd in /var/lib which is 7gb. Is this normal?
是的,这是单个快照的存储位置(从它们安装到/snap/
某处的位置)。这是正常的。
Q3:我注意到每个快照都存储了两个版本:我可以安全地删除旧版本以节省空间吗?
你可以; snapd 保留旧快照的原因是以防您需要恢复到旧快照。您可以使用snap list <snap name> --all
. 如果您确信不需要旧版本,则可以使用sudo snap remove <snap name> --revision=<snap revision>
. 请注意,您可以更改 snapd 配置以保留不同数量的快照:
$ snap set system refresh.retain=<number>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句