![如何在自定义内核的 Ubuntu 16.04 上安装 Snaps?](https://linux22.com/image/1152378/%E5%A6%82%E4%BD%95%E5%9C%A8%E8%87%AA%E5%AE%9A%E4%B9%89%E5%86%85%E6%A0%B8%E7%9A%84%20Ubuntu%2016.04%20%E4%B8%8A%E5%AE%89%E8%A3%85%20Snaps%EF%BC%9F.png)
由于安装 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 吗?