我已经安装了 Ubuntu Server 18.04,而不是旧的/etc/network/interfaces
,我的网络配置现在似乎存在于一系列 YAML 文件中/etc/netplan
,其中我实际拥有的唯一一个是/etc/netplan/50-cloud-init.yaml
:
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
ethernets:
ens3:
addresses: []
dhcp4: true
dhcp6: true
nameservers: {}
optional: true
ens4:
addresses: []
dhcp4: true
dhcp6: true
nameservers: {}
optional: true
version: 2
Run Code Online (Sandbox Code Playgroud)
这似乎是由cloud-init …
我的主目录位于/z/home/$USER
,而不是 at /home/$USER
,因此我可以在 ZFS 上拥有它。
这让 Snap 软件包无休止地感到不安。当我尝试运行它们时,它们说:
抱歉,当前不支持 /home 之外的主目录。有关详细信息,请参阅https://forum.snapcraft.io/t/11209。
当我转到该 URL 时,我得到了一种解决方法,但没有详细描述以实际实施:
如果用户的主目录在 /home 之外,则 Snapd 当前不支持运行快照。这在这里讨论。
解决方法是将挂载 /home 之外的主目录绑定到 /home。
链接的线程退化为关于正确支持任意主目录的设计应该是什么的讨论,并且对我来说如何实现所描述的解决方法并不是很明显。我尝试绑定安装/z/home/$USER
也出现在/home/$USER
,并告诉 Snap 那是我的主目录,但我想运行的 Snap 包仍然坚持我的主目录是坏的并且拒绝运行:
$ sudo mkdir /home/$USER
$ sudo chown ${USER}:${USER} /home/$USER
$ sudo mount --bind /z/home/$USER /home/$USER
$ HOME=/home/$USER any-snap-package
Sorry, home directories outside of /home are not currently supported.
See https://forum.snapcraft.io/t/11209 for details.
Run Code Online (Sandbox Code Playgroud)
究竟如何实施 Michael Vogt 在链接的 Snapcraft 论坛帖子中描述的解决方法?或者解决方法实际上不起作用?