从 18.04 升级到 20.04 后 LXD 未安装

从 18.04 升级到 20.04 后 LXD 未安装

我一直在尝试snap在我的 Ubuntu 机器上工作,但毫无进展。所以我决定升级到最新的 LTS 版本 20.04。

error: system does not fully support snapd: cannot mount squashfs image using "squashfs": mount:
       /tmp/sanity-mountpoint-760118298: wrong fs type, bad option, bad superblock on /dev/loop0,
       missing codepage or helper program, or other error.

一切似乎都安装顺利,我得到了选择 LXD 版本的提示。我按照它的推荐选择了 4.0。

但是,现在当我尝试使用安装任何东西时,apt出现以下错误(仍然与相关snap):

Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies.
 lxd-client : Depends: lxd (>= 1:0.9) but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

然后,当我运行时sudo apt --fix-broken install,它会尝试使用snap,然后我得到了这个:

Do you want to continue? [Y/n] y
Preconfiguring packages ...
(Reading database ... 290280 files and directories currently installed.)
Preparing to unpack .../archives/lxd_1%3a0.9_all.deb ...
=> Installing the LXD snap
==> Checking connectivity with the snap store
==> Installing the LXD snap from the 4.0 track for ubuntu-20.04
error: system does not fully support snapd: cannot mount squashfs image using "squashfs": mount:
       /tmp/sanity-mountpoint-353261804: wrong fs type, bad option, bad superblock on /dev/loop0,
       missing codepage or helper program, or other error.
dpkg: error processing archive /var/cache/apt/archives/lxd_1%3a0.9_all.deb (--unpack):
 new lxd package pre-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/lxd_1%3a0.9_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

由于这种情况不断循环,我现在无法安装任何东西。

$ lxd version

Command 'lxd' not found, but can be installed with:

sudo snap install lxd            # version 4.7, or
sudo apt  install lxd-installer  # version 1
sudo apt  install lxd            # version 1:0.9

See 'snap info lxd' for additional versions.
$ sestatus

Command 'sestatus' not found, but can be installed with:

sudo apt install policycoreutils

答案1

听起来你的路径没有进入/snap/bin。在我的盒子上:

$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

$ which lxd
/snap/bin/lxd

$ lxc --version
4.11

就你原来的问题而言,我上次看到这个问题是因为内核不支持squashfs。假设你使用的是 Ubuntu 20.04,请运行:

sudo apt install linux-image-generic-hwe-20.04 linux-headers-generic-hwe-20.04
sudo reboot

希望能帮助到你

相关内容