Your system is unable to reach the snap store

I tried to upgrade my windows ubuntu subystem to 18.10 using this instruction: https://linuxconfig.org/how-to-upgrade-ubuntu-to-18-10-cosmic-cuttlefish#h9-how-to-upgrade-ubuntu-the-debian-way

But within the upgrade I get this error:

 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

My firewall is disabled to I see no reason, why this would not work.

I also tried to run snap info lxd but

Interacting with snapd is not yet supported on Windows Subsystem for Linux.
This command has been left available for documentation purposes only.

Here is the complete message in the command line, when trying to run the update:

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)

Any idea, how I can fix that? The subsystem has internet connection, so I'm not sure, why it can't connect to the snap store


Solution 1:

This microsoft WSL issue completely made it work for me. Essentially it boiled down to:

  1. Abort the do-release-upgrade script
  2. Re-launch Ubuntu
  3. Remove lxd with: sudo dpkg --force depends -P lxd; sudo dpkg --force depends -P lxd-client

  4. Finish with sudo apt upgrade

Solution 2:

I was faced with the same problem and found this question.

So far, the only answer requires to abort the do-release-upgrade script. I do not want this.

Here is the solution:

When the error message from lxd appeared, you are given three choices, one of them is skip.

After choosing skip, the following message appeared:

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>

So FIRST, I opened another Ubuntu shell window and entered: sudo /etc/init.d/lxd stop The response was Stopping Container hypervisor based on LXC: (not running).

Then SECOND, I deleted the directory given in the message: sudo rm -rf /var/lib/lxd

LAST, I returned to the first Ubuntu shell window and pressed return. And chose skipagain. This time the installation continued.