一、将Ubuntu系统wsl版本升级2时报错由于虚拟磁盘系统限制,无法完成请求的操作。虚拟硬盘文件必须是未压缩和未加密的文件,并且不能是稀疏文件。
不知道电脑什么问题 运行wsl --set-default-version 2完全没反应
运行wsl --set-version Ubuntu 2时就会报错WSL2: Virtual hard disk files must be uncompressed and unencrypted and must not be sparse
根据官方文档https://docs.microsoft.com/en-us/windows/wsl/install-win10 在C:\Users\{用户名}\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc中找到localState,右键-属性-高级,将这两项都取消勾选,应用即可
二、进入Ubuntu安装docker.io时出现Unable to correct problems, you have held broken packages.
The following packages have unmet dependencies:
docker.io : Depends: containerd (>= 1.2.6-0ubuntu1~)
E: Unable to correct problems, you have held broken packages.
一开始看到了各种乱七八糟复杂的方法...其实只要安装containerd就行了,根据https://askubuntu.com/questions/1273024/docker-io-depends-containerd-1-2-6-0ubuntu1 里的方法,先运行dpkg -l containerd*,发现确实没有containerd【与container.io不一样】,apt安装containerd以后再按照docker.io就不会报错了