Quick fix for Ubuntu WSL failing to update because of systemd

Quick fix for Ubuntu WSL failing to update because of systemd

Hi everyone,

I’m a user of the Windows 10 WSL feature, where I run the Ubuntu distribution and always install the latest versions. I like to keep my packages up to date. Unfortunately, the latest Ubuntu release, 21.04 was not installed correctly and whenever I tried to update the system packages, it would error out when setting up systemd.

WSL Fix systemd 1

The solution to this seem to be a quick one. Turns out, the file libsystemd-shared-247.so was there, in the /usr/lib/systemd folder:

WSL Fix systemd 2

It seems that we can get around this issue by copying that file to the previous folder (/usr/lib, so the following command should be used:

sudo cp /usr/lib/systemd/libsystemd-shared-247.so /usr/lib/

Now, go back to the previous folder and you should have it there:

WSL Fix systemd 3

Now you should be able to update your system packages without issues.

But now I’m getting this failure 😂:

WSL Fix systemd 4