WSL: WSL --update fails with unknown error code (0x80240066)

Version

Microsoft Windows [Version 10.0.22621.674]

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

5.10.102.1

Distro Version

Ubuntu 20.04

Other Software

No response

Repro Steps

wsl --update in powershell or opening the store for wsl and press install

Expected Behavior

wsl updates / install newest version

Actual Behavior

Installing: Windows Subsystem for Linux Error: 0x80240066==========90.0%===================== ]

same error number reported by windows store

Diagnostic Logs

WslLogs-2022-10-19_13-36-09.zip

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 6
  • Comments: 32

Most upvoted comments

just update we using “wsl --update --web-download” to update the wsl successfully without any issues.

C:\Users\{USER}>wsl --update
Checking for updates.
The most recent version of Windows Subsystem for Linux is already installed.

BR//lo

I think had the same issue:

I tried to upgrade my very old WSL installation (10.0.XX, where wsl --version is not working) to the Windows Subsystem for Linux Preview from the Microsoft store (that has a version like 0.70.XX.X). But every time I tried to install, the error message 0x80240066 appeared. I even tried to install with the winget package installer, but the same error appears. Even if I call it from an elevated prompt.

winget command: winget install "Windows Subsystem for Linux Preview" --verbose-logs

So my next try was to install it manually by downloading a release from the releases github page of WSL (in my case release 0.70.4). At first I tried to install it by double clicking on the .msixbundle file. The App installer opened, but the installation did not work. Even when I called it with administrator rights.

After that I disabled the Windows Subsystem for Linux Windows feature. But that did not change anything.

So in the next attempt I tried to install the .msixbundle file with the Add-AppPackage powershell command in an elevated prompt:

Add-AppPackage .\Microsoft.WSL_0.70.4.0_x64_ARM64.msixbundle

That command also displayed a error message that said something like “A newer version is already installed”. So I checked with the Get_AppxPackage command which version is installed and it outputs a version like 10.0.XX. So yeah, theoretically if you look on the numbers this version is newer as the 0.70.4.0 that we want to install 😆

Get-AppxPackage MicrosoftCorporationII.WindowsSubsystemForLinux

So i tried to remove the package with

Remove-AppxPackage -package MicrosoftCorporationII.WindowsSubsystemForLinux

And after that I reinstalled it with the Add-AppPackage command. That worked partly. As it only updates the version of the administrator user account. So if I tiped wsl --version in the admin prompt it displayed the version 0.70.4.0, but if I type it in my own user account, it still used the old version, even after a reboot. After more googling I discovered the ps command Add-AppxProvisionedPackage that provides installing a package for all users:

Add-AppxProvisionedPackage -Online -PackagePath ".\Microsoft.WSL_0.70.4.0_x64_ARM64.msixbundle"

After a reboot I was finally able to call wsl --version from my user account! And even the Microsoft Store somehow realized the new installation, as it displays an “Open” button, instead of an “install” button on the Windows Subsystem for Linux Preview App page.

So in short if someone has the same problem, you can try the following steps:

(I created a backup tar of my currently used distro with the wsl --export ... command before I tried the upgrade. I would recommend doing this, in case anything goes wrong)

  1. Disable the “Windows Subsystem for Linux” Feature in the Windows Features and reboot
  2. Download the newest WSL release from https://github.com/microsoft/WSL/releases
  3. Open a PowerShell prompt with administrator rights
  4. You can check which version is installed with: Get-AppxPackage MicrosoftCorporationII.WindowsSubsystemForLinux
  5. Remove the old version: Remove-AppxPackage -package MicrosoftCorporationII.WindowsSubsystemForLinux
  6. Install the new version for the admin account (you need to modify the path to the .msixbundle file): Add-AppPackage .\Microsoft.WSL_0.70.4.0_x64_ARM64.msixbundle
  7. Add it to all users: Add-AppxProvisionedPackage -Online -PackagePath ".\Microsoft.WSL_0.70.4.0_x64_ARM64.msixbundle"
  8. Reboot
  9. Check again if everything worked: Get-AppxPackage MicrosoftCorporationII.WindowsSubsystemForLinux
  10. Now if you type wsl --version it should display the new version

The output of Get-AppxPackage MicrosoftCorporationII.WindowsSubsystemForLinux should be something like image

And the output from wsl --version: image

I hope this helps someone and I did not forget any step, as I cannot reproduce the whole procedure with the new installed version again.

This error may (also) occur when trying to update WSL while connected trough a VPN.

When running the command: wsl --update I received the error message: Forbidden (403). Error code: Wsl/UpdatePackage/0x80190193

After disconnecting my VPN the update ran without problems.

My current user is not a local administrator:

  • By opening a Powershell as admin, using the current local user (right click, run as admin):

    • wsl --update : fail at 90% with error code 0x80240066
    • wsl --update --web-download: fail, explicitly complaining of missing elevated priviledges
  • By opening a Powershell as admin, using the current admin local user account (right click, run as admin, more option, pick local admin user account):

    • wsl --update --web-download : worked for me

My 2ct.

commenting to make this issue possibly more visible

wsl --update --web-download solved the same issue

wsl --update --web-download This had solve the problem to me. Evidences, sometimes --update doesn’t even start, Microsoft Store doesn’t download wsl versions. Various commands errors. At least “wsl --update --web-download” solve my problem

@TheFehr: This issue should probably be fixed by WSL 2.1.0. Can you confirm if you’re still seeing it ?

I ran the wsl update command in a cmd window with normal privileges and in a cmd window running as administrator, respectively, and the following is the output:

C:\Users\Administrator> wsl --update Checking for updates. Forbidden (403). Error code: Wsl/UpdatePackage/0x80190193

C:\Users\Administrator> wsl --update --web-download Checking for updates. Forbidden (403). Error code: Wsl/UpdatePackage/0x80190193

C:\Users\Administrator> wsl --version WSL version: 2.2.4.0 Kernel version: 5.15.153.1-2 WSLg version: 1.0.61 MSRDC version: 1.2.5326 Direct3D version: 1.611.1-81528511 DXCore version: 10.0.26091.1-240325-1447.ge-release Windows version: 10.0.22631.4112

I was getting same error with exactly same WSL & Kernel versions. What worked for me was first uninstalling WSL (wsl --uninstall) and then reinstalling/updating it (wsl --update). Seems to not have destroyed any data in the distros themselves.

在通过 VPN 连接时尝试更新 WSL 时,也可能(也)发生此错误。

运行命令时:我收到错误消息: wsl --update Forbidden (403). Error code: Wsl/UpdatePackage/0x80190193

断开我的 VPN 连接后,更新运行没有问题。

tanks,bro

I had the same issue as well… I tried (almost everything).

What worked for me was to follow this manual installation guide: https://learn.microsoft.com/en-gb/windows/wsl/install-manual#step-4---download-the-linux-kernel-update-package

And specifically download the .msi package here in this link: https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi

After this i still couldn’t launch ubuntu, but that was just due to WSL not being enabled. To Enable it Press Windows + R keys, type optionalfeatures and press Enter. Then navigate to the bottom where an option for WSL is most likely disabled.