11

I'm trying to follow the directions to upgrade my WSL 1 Ubunutu (18.04) release to WSL 2 Ubuntu-20.04 and the first step gives me an error message I don't know how to work around.

wsl --set-version ubuntu 
Conversion in progress, this may take a few minutes...
For information on key differences with WSL 2 please visit https://aka.ms/wsl2
Exporting the distribution failed.
bsdtar: Couldn't read link data: I/O error
bsdtar: Error exit delayed from previous errors.

I have also tried doing it the "normal" Ubuntu way and get different "errors":

$ lsb_release -a

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.5 LTS
Release:    18.04
Codename:   bionic
cfclark@p53:
~
$ sudo apt update

Hit:1 http://ppa.launchpad.net/git-core/ppa/ubuntu bionic InRelease
Hit:2 http://archive.ubuntu.com/ubuntu bionic InRelease
Hit:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Hit:5 http://security.ubuntu.com/ubuntu bionic-security InRelease
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.
cfclark@p53:
~
$ sudo apt upgrade

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following package was automatically installed and is no longer required:
  libdumbnet1
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
cfclark@p53:
~
$ sudo do-release-upgrade

Checking for a new Ubuntu release
Get:1 Upgrade tool signature [1554 B]                                                                                                                                                                       
Get:2 Upgrade tool [1340 kB]                                                                                                                                                                                
Fetched 1342 kB in 0s (0 B/s)                                                                                                                                                                               
authenticate 'focal.tar.gz' against 'focal.tar.gz.gpg' 
extracting 'focal.tar.gz'
[4l>7[r[?1;3;4;6l87[4l=)0[1;66rlspci: Cannot find any working access method.

Checking package manager
Reading package lists... Done
Building dependency tree
Reading state information... Done
Hit http://archive.ubuntu.com/ubuntu bionic InRelease
Hit http://ppa.launchpad.net/git-core/ppa/ubuntu bionic InRelease
Hit http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Hit http://security.ubuntu.com/ubuntu bionic-security InRelease
Fetched 0 B in 0s (0 B/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done

Restoring original system state

Aborting
Reading package lists... Done
Building dependency tree
Reading state information... Done
=== Command detached from window (Sun May 23 13:26:05 2021) ===
=== Command terminated with exit status 1 (Sun May 23 13:26:15 2021) ===
intel_chris
  • 275
  • 1
  • 3
  • 10

1 Answers1

35

Running sudo apt remove --purge snapd before sudo apt dist-upgrade fixed the problem for me

Alexey Subach
  • 451
  • 3
  • 4
  • Didn't fix my issue, but was worth the try. Thanks. – intel_chris Jun 27 '21 at 11:01
  • 7
    I'm using WSL2 with Ubuntu 18.04 and this worked for me, thanks! – McFly Jul 07 '21 at 07:55
  • 10
    This fixed the problem for me also. But I had to run ```sudo do-release-upgrade``` to actually run the upgrade after purging snapd – Leon Alvarez Aug 08 '21 at 18:46
  • 1
    @Alexey how did you figure out that you needed `sudo apt remove --purge snapd`? – David LeBauer Apr 06 '22 at 01:01
  • I saw a similar answer below - which also discussed more on the root cause analysis if interested @DavidLeBauer https://askubuntu.com/questions/1067331/unable-to-upgrade-from-16-04-to-18-04-no-real-error This answer worked for me upgrading from Ubuntu 18.04 on WSL1 – MattH Sep 04 '22 at 08:02
  • Running WSL2 with Ubuntu 18.04, trying to upgrade to 20.04. Worked for me. Thanks! – sevenr Sep 08 '22 at 21:24
  • @DavidLeBauer the root cause is a broken snapd that someone found after debugging with strace. Explanation in this thread: https://askubuntu.com/questions/1078692/cant-upgrade-ubuntu-16-04-to-18-04-lts/1100514#1100514 – sevenr Sep 08 '22 at 21:29