当“wsl --export”失败时如何在 WSL 中将 ubuntu 18.04 升级到 20.04

当“wsl --export”失败时如何在 WSL 中将 ubuntu 18.04 升级到 20.04

我正在尝试按照说明将我的 WSL 1 Ubunutu (18.04) 版本升级到 WSL 2 Ubuntu-20.04,但第一步出现了一条错误消息,我不知道如何解决。

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.

我也尝试过以“正常”的 Ubuntu 方式进行操作,但得到了不同的“错误”:

$ 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) ===

答案1

sudo apt remove --purge snapd之前运行的程序sudo apt dist-upgrade为我修复了这个问题

相关内容