wsl debian 仍然在 oldoldstable 上,有什么办法获得最新版本吗?

xpt*_*xpt 11 linux debian windows-subsystem-for-linux wsl2

正如标题——

wsldebian仍在运行oldoldstable,有什么方法可以获取最新版本(debian bullseye(稳定)或 Ubuntu-22.04)?
希望我不需要自己升级发行版。

PS C:\Windows\system32> wsl --install -d Ubuntu-22.04
Invalid distribution name: 'Ubuntu-22.04'.
To get a list of valid distributions, use 'wsl --list --online'.

PS C:\Windows\system32> wsl --list --online
The following is a list of valid distributions that can be installed.
Install using 'wsl --install -d <Distro>'.

NAME            FRIENDLY NAME
Ubuntu          Ubuntu
Debian          Debian GNU/Linux
kali-linux      Kali Linux Rolling
openSUSE-42     openSUSE Leap 42
SLES-12         SUSE Linux Enterprise Server v12
Ubuntu-16.04    Ubuntu 16.04 LTS
Ubuntu-18.04    Ubuntu 18.04 LTS
Ubuntu-20.04    Ubuntu 20.04 LTS
Run Code Online (Sandbox Code Playgroud)
$ cat /etc/apt/sources.list
deb http://deb.debian.org/debian stretch main
deb http://deb.debian.org/debian stretch-updates main
deb http://security.debian.org/debian-security/ stretch/updates main
Run Code Online (Sandbox Code Playgroud)

stretcholdoldstable——https: //packages.debian.org/search?keywords =lsb-release

Not*_*1ds 13

简短回答:

更多细节:

安装发行版的方法有多种,这不是唯一的列表,而是为了“自动”安装的目的:

  1. “传统”方式是通过 Microsoft Store。在应用商店中,每个发行版维护者都会创建并更新自己的 WSL 包。您通常会在商店中找到维护者提供的最新发行版。

  2. 然后,有一段时间,Microsoft 提供了多个发行版 rootfs 软件包的 URL 列表,您可以下载这些软件包和wsl --import. 该列表似乎不再存在,但下载位置似乎是 所使用的位置wsl --install

  3. 现在,微软在我上面提到的页面上提供了 Appx 包链接的列表。

现在有令人沮丧的事情 - 所有这三种方法都可能导致安装不同的版本。不幸的是,它们没有链接、同步或协调。

例如:

  • 通过 (1) 或 (3) 安装 Debian 将导致 Bullseye 安装,但wsl --install正如您所指出的那样,通过 安装 Debian 使用了严重过时的 rootfs,从而导致 Stretch。

  • 通过 (1) 安装 Kali 会得到最新结果。但是,(2) 和 (3) 都安装 2019.02。这个版本太旧了,密钥已经过期,甚至在安装后也没有简单的方法来更新发行版。

我刚刚在全新的 Windows 11/WSL 安装上运行了每个场景,以确认情况仍然如此。

因此,至少对于 Debian,您可以通过方法(1)或(3)安装并获取 Bullseye。