microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.48k stars 822 forks source link

Can't update WSL #12140

Closed f1amy closed 1 month ago

f1amy commented 1 month ago

Windows Version

Microsoft Windows [Version 10.0.26100.1882]

WSL Version

2.2.4.0

Are you using WSL 1 or WSL 2?

Kernel Version

5.15.153.1-microsoft-standard-WSL2

Distro Version

No response

Other Software

No response

Repro Steps

  1. Open Terminal
  2. Run wsl --shutdown
  3. Run wsl --update

Expected Behavior

WSL updated from 2.2.4 to 2.3.24, verify using wsl --version

Actual Behavior

Checking for updates. Updating Windows Subsystem for Linux to version: 2.3.24. The older version of Windows Subsystem for Linux cannot be removed. Contact your technical support group. Update failed (exit code: 1603). Log file: C:\Users\{user}\AppData\Local\Temp\wsl-install-logs.txt Error code: Wsl/UpdatePackage/ERROR_INSTALL_FAILURE

Diagnostic Logs

wsl-install-logs.txt WslLogs-2024-10-07_12-56-30.zip

github-actions[bot] commented 1 month ago

View similar issues

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

Diagnostic information
.wslconfig found
Detected appx version: 2.3.24.0
Detected user visible error: Wsl/UpdatePackage/ERROR_INSTALL_FAILURE

OneBlue commented 1 month ago

@f1amy: Looking at the logs, the root cause is:

DEBUG: Error 2219:  Database: . Invalid Installer database format

Unfortunately this might mean that you're going to have to manually uninstall the previous package before installing the new one.

You can try the tools listed in this post

f1amy commented 1 month ago

Tried Microsoft fixit tool https://support.microsoft.com/en-us/topic/fix-problems-that-block-programs-from-being-installed-or-removed-cca7d1b6-65a9-3d98-426b-e9f927e1eb4d removed the package "Windows Subsystem For Linux".

After that WSL features seem to still function with previous version of 2.2.4, even if I have installed WSL package from the Microsoft Store with latest version.

However, doing wsl --update worked this time (for some reason it forced a reboot after update).

I'm getting this reported versions:

PS > wsl -v
WSL version: 2.3.24.0
Kernel version: 5.15.153.1-2
WSLg version: 1.0.65
MSRDC version: 1.2.5620
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26100.1-240331-1435.ge-release
Windows version: 10.0.26100.1882

So it looks like it resolved the issue, thanks!

OneBlue commented 1 month ago

Ok great ! Closing since the issue is resolved.

DanielCr2020 commented 4 days ago

Tried Microsoft fixit tool https://support.microsoft.com/en-us/topic/fix-problems-that-block-programs-from-being-installed-or-removed-cca7d1b6-65a9-3d98-426b-e9f927e1eb4d removed the package "Windows Subsystem For Linux".

Does this delete the data associated with your WSL? After using this tool and updating WSL, is your WSL data still there?

f1amy commented 4 days ago

@DanielCr2020 you should do a backup, but I remember it did not remove wsl data/distributions