How to fix “We couldn’t complete the update. Undoing changes” error when installing WSL

Windows Subsystem for Linux

Microsoft <3 Linux now?

So recently Microsoft rolled out their Anniversary Update and the most anticipated feature (or at least mine) was the “Windows Subsystem for Linux”. As pretty much any article on every blog on the web has already written, WSL is NOT an emulator but rather a true implementation of Ubuntu Linux that runs on Windows machines without the need for a VM.

I’m not going to go into the details of how they made the Windows Kernel and the Linux Kernel “talk” to each other… you can read plenty in one of the links I posted above, but it’s very interesting how Microsoft, historically anti-open-source and frowned upon by the Free Software community for decades, is now shifting more and more towards an open-source model for some of his products. The appeal of WSL is to run native UNIX applications and scripts directly on your machine (ant its filesystem!) which will probably render tools like Cygwin obsolete.

 

Let’s get to the point

Well, I am not writing this article to talk about what you can do with WSL, but rather on how to get it back when you install it, break something (can be for unrelated reasons) and need to restore to a previous point in time through the Windows recovery features. After the process you will notice that WSL has vanished into thin air. Normal, you might think… I’ll just re-enable it the way I did before which is through the “Turn Windows features on or off” in “Programs and Features”, selecting “Windows Subsystem for Linux” from the list of features. The system will ask you to reboot. At some point during the update process the system will flash a message along the lines of “Failed to update. Undoing changes” and when Windows is done restarting and booting up you’ll find that WSL (and the bash command to bootstrap it) is not only missing but the feature is unselected in the Windows feature list… Further attempts to activate it, using Windows Powershell as well, will result in the same type of failure. How to solve it then? Easy! Delete the following folder (and its content if any):

windir%\System32\Tasks\Microsoft\Windows\Windows Subsystem for Linux

That’s it. Now repeat the installation process and you are gold.

It took me a couple days of frustration before I found this Github thread.

Well I hope this help some fellow Windows/Linux users…

Good Luck!

Leave a Reply

Your email address will not be published. Required fields are marked *