您的系统无法访问 snap 商店

您的系统无法访问 snap 商店

我尝试使用以下指令将我的 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 商店

答案1

微软 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

答案2

我遇到了同样的问题并发现了这个问题。

到目前为止,唯一的答案是中止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 shell 窗口并输入:sudo /etc/init.d/lxd stop 响应是Stopping Container hypervisor based on LXC: (not running).

然后第二,我删除了消息中给出的目录:sudo rm -rf /var/lib/lxd

最后的,我返回第一个 Ubuntu shell 窗口并按回车键。然后skip再次选择。这次安装继续。

答案3

JBCP 方法对我来说效果很好。小区别:我在运行 do-release-upgrade 之前停止了 lxd 并删除了 /var/lib/lxd。现在,当系统到达该点时,我只需点击“跳过”即可。没有额外的窗口或步骤。非常感谢,尽管我不会发现这一点。

相关内容