Oui. D’abord, notez l’URL de la distribution que vous voulez installer dans cette liste, par exemple : https://aka.ms/wslubuntu2204
Maintenant ouvrez PowerShell :
`# Substitute the drive on which you
want WSL to be installed if not D:
Set-Location D:
Create a directory for our installation and change to it, we’ll call it WSL:
New-Item WSL -Type Directory
Set-Location .\WSL
Using the URL you found above, download the appx package:
curl.exe -L -o Linux.appx <distribution_package_url>
Make a backup and unpack:
Copy-Item .\Linux.appx .\Linux.zip
Expand-Archive .\Linux.zip
Search for the installer:
Get-Childitem -Filter *.exe
Vous pourriez trouver un fichier nommé `<distribution>.exe`. Exécutez ce fichier, et la distribution WSL devrait être installée dans le dossier décompressé de l'autre lecteur. Si vous ne voyez pas d'exécutable, cherchons un fichier .appx qui vient d'être décompressé, qui est la variante que vous voulez, et décompressez-le, comme suit :
Set-Location Linux
look for correct appx file:
Get-Childitem -Filter *.appx
rename to .zip so that Expand-Archive will work
ren .\Ubuntu_2204.1.7.0_x64.appx .\Ubuntu_2204.zip
Expand-Archive .\Ubuntu_2204.zip
Set-Location .\Ubuntu_2204
Now exe should exist:
Get-Childitem -Filter *.exe
run it
.\ubuntu.exe
Une fois terminé, vous pouvez maintenant supprimer tout ce qui vient d'être téléchargé/créé sauf `ext4.vhdx` (pour WSL2) ou `rootfs` (pour WSL1), et le fichier `ubuntu.exe`, qui démarre cette distribution et peut changer le nom d'utilisateur par défaut.