由于安装 snap core 时出现错误,我无法在 Ubuntu 16.04 中安装任何 Snap 软件包。我发现问题是由于在 Ubuntu 上使用自定义内核造成的。我的内核是针对 Surface Pro 修改的 4.4.0.20-36。任何 snap 命令的输出如下:
$ sudo snap install notes
error: cannot perform the following tasks:
- Mount snap "core" (3604) ([start snap-core-3604.mount] failed with
exit status 1: Job for snap-core-3604.mount failed. See "systemctl
status snap-core-3604.mount" and "journalctl -xe" for details.
)
systemctl status snap-core-3604.mount 的输出:
snap-core-3604.mount - Mount unit for core
Loaded: loaded (/etc/systemd/system/snap-core-3604.mount; enabled;
vendor preset: enabled)
Active: failed (Result: timeout) since Sat 2017-12-16 22:22:23
AEDT; 17min ago
Where: /snap/core/3604
What: /var/lib/snapd/snaps/core_3604.snap
CGroup: /system.slice/snap-core-3604.mount
└─7380 /bin/mount /var/lib/snapd/snaps/core_3604.snap
/snap/core/3604 -t squashfs -o nodev,ro
Dec 16 22:17:52 rahn-Surface-Pro-3 systemd[1]: Mounting Mount unit for
core...
Dec 16 22:19:22 rahn-Surface-Pro-3 systemd[1]: snap-core-3604.mount:
Mounting timed out. Stopping.
Dec 16 22:20:53 rahn-Surface-Pro-3 systemd[1]: snap-core-3604.mount:
Mounting timed out. Killing.
Dec 16 22:22:23 rahn-Surface-Pro-3 systemd[1]: snap-core-3604.mount:
Mount process still around after SIGKILL. Ignoring.
Dec 16 22:22:23 rahn-Surface-Pro-3 systemd[1]: Failed to mount Mount
unit for core.
Dec 16 22:22:23 rahn-Surface-Pro-3 systemd[1]: snap-core-3604.mount:
Unit entered failed state.
答案1
这是因为(据我所知)上游 Linux 源代码不支持限制。你可以从中找到相应的补丁Ubuntu 主线内核并使用此补丁构建内核。此外,真的没有其他内核可以满足您的需求并允许您安装 snap 吗?