您的系统无法访问Snap Store。

我尝试按照这个指南将我的Windows Ubuntu子系统升级到18.10版本: https://linuxconfig.org/how-to-upgrade-ubuntu-to-18-10-cosmic-cuttlefish#h9-how-to-upgrade-ubuntu-the-debian-way 但在升级过程中,我遇到了以下错误:
 Your system is unable to reach the snap store, please make sure you're connected to the Internet and update any   │
 │ firewall or proxy settings as needed so that you can reach the snap store.                                        │
 │                                                                                                                   │
 │ You can manually check for connectivity by running "snap info lxd"                                                │
 │                                                                                                                   │
 │ Aborting will cause the upgrade to fail and will require it to be re-attempted once snapd is functional on the    │
 │ system.                                                                                                           │
 │                                                                                                                   │
 │ Unable to reach the snap store

我的防火墙已经禁用,所以我看不出为什么这个不会起作用。
我还尝试运行了`snap info lxd`,但是...
Interacting with snapd is not yet supported on Windows Subsystem for Linux.
This command has been left available for documentation purposes only.

以下是在尝试运行更新时,在命令行中显示的完整消息:
The following additional packages will be installed:
  lxd
The following packages will be upgraded:
  lxd
1 upgraded, 0 newly installed, 0 to remove and 227 not upgraded.
180 not fully installed or removed.
Need to get 0 B/11.1 kB of archives.
After this operation, 20.5 MB disk space will be freed.
Do you want to continue? [Y/n] y
Preconfiguring packages ...
(Reading database ... 61051 files and directories currently installed.)
Preparing to unpack .../archives/lxd_1%3a0.4_all.deb ...
invoke-rc.d: could not determine current runlevel
Stopping Container hypervisor based on LXC: (not running).
=> Installing the LXD snap
==> Checking connectivity with the snap store
===> Unable to contact the store
===> Aborting at user request
dpkg: error processing archive /var/cache/apt/archives/lxd_1%3a0.4_all.deb (--unpack):
 new lxd package pre-installation script subprocess returned error exit status 1
invoke-rc.d: could not determine current runlevel
Errors were encountered while processing:
 /var/cache/apt/archives/lxd_1%3a0.4_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

有什么办法可以修复这个问题吗?子系统已经连接到互联网,所以我不确定为什么它无法连接到Snap商店。

3你不能在WSL中运行LXD。它不支持使LXD工作所需的基本要求。即使它支持,听起来Snaps也无法在WSL中工作。你没有受限制的子网或网络,对吧? - Thomas Ward
其实我不想运行LXD(在升级之前我从未听说过它),但系统仍然试图安装它:lxd-client:依赖于lxd(>=1:0.4),但将不会安装 E:无法满足的依赖关系。尝试使用“apt --fix-broken install”而不需要任何软件包(或指定解决方案)。``` - Zoker
1所以执行sudo apt-get remove lxd lxd-client。请注意,系统无法访问Snapcraft意味着在WSL中可能会出现一些奇怪的问题,因为它并不是真正的Ubuntu,而是在Windows系统调用上运行的Ubuntu,这可能会引起一些麻烦。 - Thomas Ward
4我实际上需要执行sudo apt remove lxd lxd-client。我仍然想知道为什么它首先被安装了。 - Zoker
3个回答

这个微软WSL问题完全解决了我的问题。基本上就是:
  1. 中止do-release-upgrade脚本
  2. 重新启动Ubuntu
  3. 使用以下命令删除lxd:sudo dpkg --force depends -P lxd; sudo dpkg --force depends -P lxd-client

  4. 最后执行sudo apt upgrade


第三步真是救了我的一天!谢谢,伙计!:) - David Bendahan
如何中止do-release-upgrade脚本? - Quinten C

我面临着同样的问题,并找到了这个问题。
到目前为止,唯一的答案是要中止do-release-upgrade脚本。我不想这样做。
以下是解决方案:
lxd出现错误消息时,你会有三个选择,其中之一是跳过
选择跳过后,会出现以下消息:
Skipping is not allowed when LXD has been initialized                                                                                                                  
LXD appears to have been configured on this system.
Please stop LXD and remove local data in /var/lib/lxd/ if  
you would like to skip installing the LXD snap and migrating the local data.                                    
                                     <Ok>

首先,我打开了另一个Ubuntu终端窗口,并输入了以下命令:sudo /etc/init.d/lxd stop 回应是:Stopping Container hypervisor based on LXC: (not running). 然后,第二步,我删除了消息中给出的目录:sudo rm -rf /var/lib/lxd 最后,我回到第一个Ubuntu终端窗口,按下回车键。然后再次选择skip。这次安装继续进行。

JBCP方法对我非常有效。只有一个小差别:在运行do-release-upgrade之前,我停止了lxd并删除了/var/lib/lxd。现在当系统到达那一点时,我只需点击“跳过”。没有额外的窗口或步骤。非常感谢,否则我可能找不到这个方法。