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
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 6
- Comments: 32
just update we using “wsl --update --web-download” to update the wsl successfully without any issues.
BR//lo
I think had the same issue:
I tried to upgrade my very old WSL installation (10.0.XX, where
wsl --versionis 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-logsSo 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.msixbundleThat 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.WindowsSubsystemForLinuxSo i tried to remove the package with
Remove-AppxPackage -package MicrosoftCorporationII.WindowsSubsystemForLinuxAnd after that I reinstalled it with the
Add-AppPackagecommand. That worked partly. As it only updates the version of the administrator user account. So if I tipedwsl --versionin 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 commandAdd-AppxProvisionedPackagethat 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 --versionfrom 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)Get-AppxPackage MicrosoftCorporationII.WindowsSubsystemForLinuxRemove-AppxPackage -package MicrosoftCorporationII.WindowsSubsystemForLinuxAdd-AppPackage .\Microsoft.WSL_0.70.4.0_x64_ARM64.msixbundleAdd-AppxProvisionedPackage -Online -PackagePath ".\Microsoft.WSL_0.70.4.0_x64_ARM64.msixbundle"Get-AppxPackage MicrosoftCorporationII.WindowsSubsystemForLinuxwsl --versionit should display the new versionThe output of
Get-AppxPackage MicrosoftCorporationII.WindowsSubsystemForLinuxshould be something likeAnd the output from
wsl --version: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 --updateI received the error message:Forbidden (403). Error code: Wsl/UpdatePackage/0x80190193After 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 code0x80240066wsl --update --web-download: fail, explicitly complaining of missing elevated priviledgesBy 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 meMy 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
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.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.