![在 14.04 上安装 snapd 失败](https://linux22.com/image/1005838/%E5%9C%A8%2014.04%20%E4%B8%8A%E5%AE%89%E8%A3%85%20snapd%20%E5%A4%B1%E8%B4%A5.png)
我有一个运行 14.04 的虚拟服务器,由 Host Europe 托管。我想使用 安装 Nextcloud snap
。但是,安装snapd
失败:
$ sudo apt install snapd
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
cgroup-lite crda dmsetup grub-common grub-gfxpayload-lists grub-pc
grub-pc-bin grub2-common iw libcryptsetup4 libdevmapper1.02.1 libfuse2
libsystemd-journal0 linux-generic-lts-xenial linux-headers-4.4.0-112
linux-headers-4.4.0-112-generic linux-headers-generic-lts-xenial
linux-image-4.4.0-112-generic linux-image-extra-4.4.0-112-generic
linux-image-generic-lts-xenial squashfs-tools systemd thermald
wireless-regdb
Suggested packages:
multiboot-doc grub-emu xorriso desktop-base console-setup fuse fdutils
linux-lts-xenial-tools systemd-ui
The following NEW packages will be installed:
cgroup-lite crda dmsetup grub-common grub-gfxpayload-lists grub-pc
grub-pc-bin grub2-common iw libcryptsetup4 libdevmapper1.02.1 libfuse2
libsystemd-journal0 linux-generic-lts-xenial linux-headers-4.4.0-112
linux-headers-4.4.0-112-generic linux-headers-generic-lts-xenial
linux-image-4.4.0-112-generic linux-image-extra-4.4.0-112-generic
linux-image-generic-lts-xenial snapd squashfs-tools systemd thermald
wireless-regdb
0 upgraded, 25 newly installed, 0 to remove and 0 not upgraded.
Need to get 85.7 MB of archives.
After this operation, 408 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://ftp.hosteurope.de/mirror/archive.ubuntu.com/ trusty/main dmsetup amd64 2:1.02.77-6ubuntu2 [37.6 kB]
Get:2 http://ftp.hosteurope.de/mirror/archive.ubuntu.com/ trusty/main libdevmapper1.02.1 amd64 2:1.02.77-6ubuntu2 [93.3 kB]
Get:3 http://ftp.hosteurope.de/mirror/archive.ubuntu.com/ trusty-security/main libfuse2 amd64 2.9.2-4ubuntu4.14.04.1 [87.4 kB]
Get:4 http://ftp.hosteurope.de/mirror/archive.ubuntu.com/ trusty-security/main libsystemd-journal0 amd64 204-5ubuntu20.26 [51.0 kB]
Get:5 http://ftp.hosteurope.de/mirror/archive.ubuntu.com/ trusty/main wireless-regdb all 2013.02.13-1ubuntu1 [6456 B]
Get:6 http://ftp.hosteurope.de/mirror/archive.ubuntu.com/ trusty/main crda amd64 1.1.2-1ubuntu2 [15.2 kB]
Get:7 http://ftp.hosteurope.de/mirror/archive.ubuntu.com/ trusty-updates/main grub-common amd64 2.02~beta2-9ubuntu1.14 [1679 kB]
Get:8 http://ftp.hosteurope.de/mirror/archive.ubuntu.com/ trusty-updates/main grub2-common amd64 2.02~beta2-9ubuntu1.14 [501 kB]
Get:9 http://ftp.hosteurope.de/mirror/archive.ubuntu.com/ trusty-updates/main grub-pc-bin amd64 2.02~beta2-9ubuntu1.14 [882 kB]
Get:10 http://ftp.hosteurope.de/mirror/archive.ubuntu.com/ trusty-updates/main grub-pc amd64 2.02~beta2-9ubuntu1.14 [174 kB]
Get:11 http://ftp.hosteurope.de/mirror/archive.ubuntu.com/ trusty/main grub-gfxpayload-lists amd64 0.6 [3506 B]
Get:12 http://ftp.hosteurope.de/mirror/archive.ubuntu.com/ trusty/main iw amd64 3.4-1 [51.7 kB]
Get:13 http://ftp.hosteurope.de/mirror/archive.ubuntu.com/ trusty/main libcryptsetup4 amd64 2:1.6.1-1ubuntu1 [77.0 kB]
Get:14 http://ftp.hosteurope.de/mirror/archive.ubuntu.com/ trusty-security/main linux-image-4.4.0-112-generic amd64 4.4.0-112.135~14.04.1 [20.9 MB]
Get:15 http://ftp.hosteurope.de/mirror/archive.ubuntu.com/ trusty-security/main linux-image-extra-4.4.0-112-generic amd64 4.4.0-112.135~14.04.1 [35.7 MB]
Get:16 http://ftp.hosteurope.de/mirror/archive.ubuntu.com/ trusty-security/main linux-image-generic-lts-xenial amd64 4.4.0.112.96 [2516 B]
Get:17 http://ftp.hosteurope.de/mirror/archive.ubuntu.com/ trusty-security/main linux-headers-4.4.0-112 all 4.4.0-112.135~14.04.1 [9923 kB]
Get:18 http://ftp.hosteurope.de/mirror/archive.ubuntu.com/ trusty-security/main linux-headers-4.4.0-112-generic amd64 4.4.0-112.135~14.04.1 [773 kB]
Get:19 http://ftp.hosteurope.de/mirror/archive.ubuntu.com/ trusty-security/main linux-headers-generic-lts-xenial amd64 4.4.0.112.96 [2486 B]
Get:20 http://ftp.hosteurope.de/mirror/archive.ubuntu.com/ trusty-security/main linux-generic-lts-xenial amd64 4.4.0.112.96 [1800 B]
Get:21 http://ftp.hosteurope.de/mirror/archive.ubuntu.com/ trusty/main cgroup-lite all 1.9 [3918 B]
Get:22 http://ftp.hosteurope.de/mirror/archive.ubuntu.com/ trusty-updates/main squashfs-tools amd64 1:4.2+20130409-2ubuntu0.14.04.2 [90.6 kB]
Get:23 http://ftp.hosteurope.de/mirror/archive.ubuntu.com/ trusty-security/main systemd amd64 204-5ubuntu20.26 [1425 kB]
Get:24 http://ftp.hosteurope.de/mirror/archive.ubuntu.com/ trusty-updates/universe snapd amd64 2.29.4.2~14.04 [13.0 MB]
Get:25 http://ftp.hosteurope.de/mirror/archive.ubuntu.com/ trusty-updates/main thermald amd64 1.4.3-5~14.04.4 [202 kB]
Fetched 85.7 MB in 7s (11.4 MB/s)
Preconfiguring packages ...
Selecting previously unselected package dmsetup.
(Reading database ... 146702 files and directories currently installed.)
Preparing to unpack .../dmsetup_2%3a1.02.77-6ubuntu2_amd64.deb ...
Unpacking dmsetup (2:1.02.77-6ubuntu2) ...
Selecting previously unselected package libdevmapper1.02.1:amd64.
Preparing to unpack .../libdevmapper1.02.1_2%3a1.02.77-6ubuntu2_amd64.deb ...
Unpacking libdevmapper1.02.1:amd64 (2:1.02.77-6ubuntu2) ...
Selecting previously unselected package libfuse2:amd64.
Preparing to unpack .../libfuse2_2.9.2-4ubuntu4.14.04.1_amd64.deb ...
Unpacking libfuse2:amd64 (2.9.2-4ubuntu4.14.04.1) ...
Selecting previously unselected package libsystemd-journal0:amd64.
Preparing to unpack .../libsystemd-journal0_204-5ubuntu20.26_amd64.deb ...
Unpacking libsystemd-journal0:amd64 (204-5ubuntu20.26) ...
Selecting previously unselected package wireless-regdb.
Preparing to unpack .../wireless-regdb_2013.02.13-1ubuntu1_all.deb ...
Unpacking wireless-regdb (2013.02.13-1ubuntu1) ...
Selecting previously unselected package crda.
Preparing to unpack .../crda_1.1.2-1ubuntu2_amd64.deb ...
Unpacking crda (1.1.2-1ubuntu2) ...
Selecting previously unselected package grub-common.
Preparing to unpack .../grub-common_2.02~beta2-9ubuntu1.14_amd64.deb ...
Unpacking grub-common (2.02~beta2-9ubuntu1.14) ...
Selecting previously unselected package grub2-common.
Preparing to unpack .../grub2-common_2.02~beta2-9ubuntu1.14_amd64.deb ...
Unpacking grub2-common (2.02~beta2-9ubuntu1.14) ...
Selecting previously unselected package grub-pc-bin.
Preparing to unpack .../grub-pc-bin_2.02~beta2-9ubuntu1.14_amd64.deb ...
Unpacking grub-pc-bin (2.02~beta2-9ubuntu1.14) ...
Selecting previously unselected package grub-pc.
Preparing to unpack .../grub-pc_2.02~beta2-9ubuntu1.14_amd64.deb ...
Unpacking grub-pc (2.02~beta2-9ubuntu1.14) ...
Selecting previously unselected package grub-gfxpayload-lists.
Preparing to unpack .../grub-gfxpayload-lists_0.6_amd64.deb ...
Unpacking grub-gfxpayload-lists (0.6) ...
Selecting previously unselected package iw.
Preparing to unpack .../archives/iw_3.4-1_amd64.deb ...
Unpacking iw (3.4-1) ...
Selecting previously unselected package libcryptsetup4.
Preparing to unpack .../libcryptsetup4_2%3a1.6.1-1ubuntu1_amd64.deb ...
Unpacking libcryptsetup4 (2:1.6.1-1ubuntu1) ...
Selecting previously unselected package linux-image-4.4.0-112-generic.
Preparing to unpack .../linux-image-4.4.0-112-generic_4.4.0-112.135~14.04.1_amd64.deb ...
Done.
Unpacking linux-image-4.4.0-112-generic (4.4.0-112.135~14.04.1) ...
Selecting previously unselected package linux-image-extra-4.4.0-112-generic.
Preparing to unpack .../linux-image-extra-4.4.0-112-generic_4.4.0-112.135~14.04.1_amd64.deb ...
Unpacking linux-image-extra-4.4.0-112-generic (4.4.0-112.135~14.04.1) ...
Selecting previously unselected package linux-image-generic-lts-xenial.
Preparing to unpack .../linux-image-generic-lts-xenial_4.4.0.112.96_amd64.deb ...
Unpacking linux-image-generic-lts-xenial (4.4.0.112.96) ...
Selecting previously unselected package linux-headers-4.4.0-112.
Preparing to unpack .../linux-headers-4.4.0-112_4.4.0-112.135~14.04.1_all.deb ...
Unpacking linux-headers-4.4.0-112 (4.4.0-112.135~14.04.1) ...
Selecting previously unselected package linux-headers-4.4.0-112-generic.
Preparing to unpack .../linux-headers-4.4.0-112-generic_4.4.0-112.135~14.04.1_amd64.deb ...
Unpacking linux-headers-4.4.0-112-generic (4.4.0-112.135~14.04.1) ...
Selecting previously unselected package linux-headers-generic-lts-xenial.
Preparing to unpack .../linux-headers-generic-lts-xenial_4.4.0.112.96_amd64.deb ...
Unpacking linux-headers-generic-lts-xenial (4.4.0.112.96) ...
Selecting previously unselected package linux-generic-lts-xenial.
Preparing to unpack .../linux-generic-lts-xenial_4.4.0.112.96_amd64.deb ...
Unpacking linux-generic-lts-xenial (4.4.0.112.96) ...
Selecting previously unselected package cgroup-lite.
Preparing to unpack .../cgroup-lite_1.9_all.deb ...
Unpacking cgroup-lite (1.9) ...
Selecting previously unselected package squashfs-tools.
Preparing to unpack .../squashfs-tools_1%3a4.2+20130409-2ubuntu0.14.04.2_amd64.deb ...
Unpacking squashfs-tools (1:4.2+20130409-2ubuntu0.14.04.2) ...
Selecting previously unselected package systemd.
Preparing to unpack .../systemd_204-5ubuntu20.26_amd64.deb ...
Unpacking systemd (204-5ubuntu20.26) ...
Selecting previously unselected package snapd.
Preparing to unpack .../snapd_2.29.4.2~14.04_amd64.deb ...
Unpacking snapd (2.29.4.2~14.04) ...
Selecting previously unselected package thermald.
Preparing to unpack .../thermald_1.4.3-5~14.04.4_amd64.deb ...
Unpacking thermald (1.4.3-5~14.04.4) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Processing triggers for install-info (5.2.0.dfsg.1-2) ...
Setting up libfuse2:amd64 (2.9.2-4ubuntu4.14.04.1) ...
Setting up libsystemd-journal0:amd64 (204-5ubuntu20.26) ...
Setting up wireless-regdb (2013.02.13-1ubuntu1) ...
Setting up crda (1.1.2-1ubuntu2) ...
Setting up iw (3.4-1) ...
Setting up linux-image-4.4.0-112-generic (4.4.0-112.135~14.04.1) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-112-generic /boot/vmlinuz-4.4.0-112-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-112-generic /boot/vmlinuz-4.4.0-112-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-112-generic
E: /usr/share/initramfs-tools/hooks/fixrtc failed with return 1.
update-initramfs: failed for /boot/initrd.img-4.4.0-112-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-4.4.0-112-generic.postinst line 1052.
dpkg: error processing package linux-image-4.4.0-112-generic (--configure):
subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of linux-image-extra-4.4.0-112-generic:
linux-image-extra-4.4.0-112-generic depends on linux-image-4.4.0-112-generic; however:
Package linux-image-4.4.0-112-generic is not configured yet.
dpkg: error processing package linux-image-extra-4.4.0-112-generic (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-image-generic-lts-xenial:
linux-image-generic-lts-xenial depends on linux-image-4.4.0-112-generic; however:
Package linux-image-4.4.0-112-generic is not configured yet.
linux-image-generic-lts-xenial depends on linux-image-extra-4.4.0-112-generic; however:
Package linux-image-extra-4.4.0-112-generic is not configured yet.
dpkg: error processing package linux-image-generic-lts-xenial (--configure):
dependency problems - leaving unconfigured
Setting up linux-headers-4.4.0-112 (4.4.0-112.135~14.04.1) ...
Setting up linux-headers-4.4.0-112-generic (4.4.0-112.135~14.04.1) ...
Setting up linux-headers-generic-lts-xenial (4.4.0.112.96) ...
dpkg: dependency problems prevent configuration of linux-generic-lts-xenial:
linux-generic-lts-xenial depends on linux-image-generic-lts-xenial (= 4.4.0.112.96); however:
Package linux-image-generic-lts-xenial is not configured yet.
dpkg: error processing package linux-generic-lts-xenial (--configure):
dependency problems - leaving unconfigured
Setting up cgroup-lite (1.9) ...
cgroup-lite start/running
Setting up squashfs-tools (1:4.2+20130409-2ubuntu0.14.04.2) ...
dpkg: dependency problems prevent configuration of snapd:
snapd depends on linux-generic-lts-xenial; however:
Package linux-generic-lts-xenial is not configured yet.
dpkg: error processing package snapd (--configure):
dependency problems - leaving unconfigured
Setting up thermald (1.4.3-5~14.04.4) ...
thermald start/running, process 10038
Setting up libdevmapper1.02.1:amd64 (2:1.02.77-6ubuntu2) ...
Setting up grub-common (2.02~beta2-9ubuntu1.14) ...
Setting up grub2-common (2.02~beta2-9ubuntu1.14) ...
Setting up grub-pc-bin (2.02~beta2-9ubuntu1.14) ...
Setting up grub-pc (2.02~beta2-9ubuntu1.14) ...
Setting up grub-gfxpayload-lists (0.6) ...
Setting up libcryptsetup4 (2:1.6.1-1ubuntu1) ...
Setting up systemd (204-5ubuntu20.26) ...
systemd start/running, process 10241
Setting up dmsetup (2:1.02.77-6ubuntu2) ...
update-initramfs: deferring update (trigger activated)
Processing triggers for libc-bin (2.19-0ubuntu6.14) ...
Processing triggers for initramfs-tools (0.103ubuntu4.10) ...
Errors were encountered while processing:
linux-image-4.4.0-112-generic
linux-image-extra-4.4.0-112-generic
linux-image-generic-lts-xenial
linux-generic-lts-xenial
snapd
E: Sub-process /usr/bin/dpkg returned an error code (1)
尝试运行snap
会导致错误:
$ sudo snap install hello-world
error: cannot communicate with server: Post http://localhost/v2/snaps/hello-world: dial unix /run/snapd.socket: connect: no such file or directory
我之前已经尝试安装过snapd
。安装程序末尾列出的软件包
Errors were encountered while processing:
linux-image-4.4.0-112-generic
linux-image-extra-4.4.0-112-generic
linux-image-generic-lts-xenial
linux-generic-lts-xenial
snapd
导致所有进一步的运行尝试都sudo apt upgrade -f
失败sudo dpkg --configure -a
。我不得不使用sudo dpkg --purge --force-remove-reinstreq PACKAGE_NAME
来删除这些包。即便如此,我还是无法摆脱linux-image-extra-4.4.0-112-generic
,所以我不得不手动将其从 中删除/var/lib/dpkg/status
。
我当前正在运行的内核:
$ uname -r
3.13.0-042stab127.2
答案1
只需重启即可。您已获得新内核(snapd 的先决条件),但您尚未运行它。重启后,一切都应该正常工作。
答案2
托管公司刚刚告诉我,snapd
由于正在使用容器虚拟化,因此无法在托管虚拟服务器上使用。虚拟服务器的容器共享主机系统的内核。因此,无法升级内核或使用其他内核。