<p>Oui. D’abord, notez l’URL de la distribution que vous voulez installer dans <a href="https://docs.microsoft.com/en-us/windows/wsl/install-manual#downloading-distributions">cette liste</a>, par exemple : <code>https://aka.ms/wslubuntu2204</code></p>
<p>Maintenant ouvrez PowerShell :<br>
# Substitute the drive on which you</p>
<h1><a name="p-13698-want-wsl-to-be-installed-if-not-d-1" class="anchor" href="#p-13698-want-wsl-to-be-installed-if-not-d-1" aria-label="Heading link"></a>want WSL to be installed if not D:</h1>
<p>Set-Location D:</p>
<h1><a name="p-13698-create-a-directory-for-our-installation-and-change-to-it-well-call-it-wsl-2" class="anchor" href="#p-13698-create-a-directory-for-our-installation-and-change-to-it-well-call-it-wsl-2" aria-label="Heading link"></a>Create a directory for our installation and change to it, we’ll call it WSL:</h1>
<p>New-Item WSL -Type Directory<br>
Set-Location .\WSL</p>
<h1><a name="p-13698-using-the-url-you-found-above-download-the-appx-package-3" class="anchor" href="#p-13698-using-the-url-you-found-above-download-the-appx-package-3" aria-label="Heading link"></a>Using the URL you found above, download the appx package:</h1>
<p>curl.exe -L -o Linux.appx <distribution_package_url></p>
<h1><a name="p-13698-make-a-backup-and-unpack-4" class="anchor" href="#p-13698-make-a-backup-and-unpack-4" aria-label="Heading link"></a>Make a backup and unpack:</h1>
<p>Copy-Item .\Linux.appx .\Linux.zip<br>
Expand-Archive .\Linux.zip</p>
<h1><a name="p-13698-search-for-the-installer-5" class="anchor" href="#p-13698-search-for-the-installer-5" aria-label="Heading link"></a>Search for the installer:</h1>
<p>Get-Childitem -Filter *.exe</p>
<pre><code class="lang-auto">
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 :
</code></pre>
<p>Set-Location Linux</p>
<h1><a name="p-13698-look-for-correct-appx-file-6" class="anchor" href="#p-13698-look-for-correct-appx-file-6" aria-label="Heading link"></a>look for correct appx file:</h1>
<p>Get-Childitem -Filter *.appx</p>
<h1><a name="p-13698-rename-to-zip-so-that-expand-archive-will-work-7" class="anchor" href="#p-13698-rename-to-zip-so-that-expand-archive-will-work-7" aria-label="Heading link"></a>rename to .zip so that Expand-Archive will work</h1>
<p>ren .\Ubuntu_2204.1.7.0_x64.appx .\Ubuntu_2204.zip<br>
Expand-Archive .\Ubuntu_2204.zip<br>
Set-Location .\Ubuntu_2204</p>
<h1><a name="p-13698-now-exe-should-exist-8" class="anchor" href="#p-13698-now-exe-should-exist-8" aria-label="Heading link"></a>Now exe should exist:</h1>
<p>Get-Childitem -Filter *.exe</p>
<h1><a name="p-13698-run-it-9" class="anchor" href="#p-13698-run-it-9" aria-label="Heading link"></a>run it</h1>
<p>.\ubuntu.exe</p>
<pre><code class="lang-auto">
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.</code></pre>