Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core OS changes in Debian Bookworm break under WSL 1 #8927

Closed
1 of 2 tasks
seanthegeek opened this issue Sep 29, 2022 · 14 comments
Closed
1 of 2 tasks

Core OS changes in Debian Bookworm break under WSL 1 #8927

seanthegeek opened this issue Sep 29, 2022 · 14 comments
Labels

Comments

@seanthegeek
Copy link

seanthegeek commented Sep 29, 2022

Version

Microsoft Windows [Version 10.0.22000.978]

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

Linux 4.4.0-22000-Microsoft

Distro Version

Debian Bookworm

Other Software

No response

Repro Steps

  1. Start with an install of Debian Bullseye
  2. (attempt to) upgrade to Debian Bookworm

Expected Behavior

All system-critical/essential/default packages should upgrade correctly.

Actual Behavior

The installation of usrmerge fails. This bug effectively breaks the entire install of Debian Bookworm on
WSL 1.0
, because usrmerge is now a required dependency of the
essential/system-critical package init-system-helpers, as of version
1.65~exp1 through the current version (1.65.2) of that package.

Diagnostic Logs

Setting up usrmerge (31) ...
mv: cannot move '/lib/x86_64-linux-gnu/security' to
'/usr/lib/x86_64-linux-gnu/security': Permission denied

FATAL ERROR:
mv --no-clobber /lib/x86_64-linux-gnu/security
/usr/lib/x86_64-linux-gnu/security: rc=1

You can try correcting the errors reported and running again
/usr/lib/usrmerge/convert-usrmerge until it will complete without errors.
Do not install or update other Debian packages until the program
has been run successfully.

E: usrmerge failed.
dpkg: error processing package usrmerge (--configure):
installed usrmerge package post-installation script subprocess
returned error exit status 1
Errors were encountered while processing:
usrmerge
E: Sub-process /usr/bin/dpkg returned an error code (1)

@seanthegeek
Copy link
Author

@benhillis benhillis added the wsl1 label Sep 30, 2022
@seanthegeek
Copy link
Author

Debian bug closed with this note


I've talked with both the internal team and the Debian maintainer of
the WSL image. This is a WSL 1.0 specific issue, and there's not much
we can do in usrmerge about it, as it's related to the underlying
filesystem that we can't touch anyway.

The Debian stable WSL image in the store will be updated shortly to be
merged-usr out of the box, so this won't happen again for new
installations, and on upgrade to bookworm it will be a no-op. Older
installations on WSL 1.0 will have to remove and reinstall, unless a
workaround is found, but for that please use the upstream bug tracker
as here we really can't figure out what the problem is.

Also please note that it would be a good idea to just move to WSL 2.0
for all use cases at this point.

Hence, setting the forwarded address and closing.

-- 
Kind regards,
Luca Boccassi

@bluca
Copy link
Member

bluca commented Oct 1, 2022

A new upload to the store has been done by the maintainer, and the Debian image is now merged-usr by default. Users on WSL 1.0 can uninstall and reinstall to fix this problem.

@firewave
Copy link

This also applies to Kali Linux which is based on Debian:

Setting up usrmerge (33) ...
mv: cannot move '/lib/x86_64-linux-gnu/security' to '/usr/lib/x86_64-linux-gnu/security': Permission denied

FATAL ERROR:
mv --no-clobber /lib/x86_64-linux-gnu/security /usr/lib/x86_64-linux-gnu/security: rc=1

It just broke with the latest updates from last night though.

@firewave
Copy link

The WSL1 Kali Linux now changed to

Setting up systemd (252-2) ...
systemd-machine-id-setup: error while loading shared libraries: libsystemd-shared-251.so: cannot open shared object file: No such file or directory

@firewave
Copy link

I was able to bypass the libsystemd-shared-251.so issue by re-adding the older files to the system and getting past that.

Then I ran into the issue that files exist in /lib/x86_64-linux-gnu and /usr/lib/x86_64-linux-gnu which I was able resolve by getting rid of the ones in /usr/lib.

That got me back to the initial issue.

It is extremely weird since it was able to copy/move several files between those folders already. There's no security folder in /usr/lib/x86_64-linux-gnu yet.

@firewave
Copy link

firewave commented Jan 6, 2023

I was able to work around the issue by doing

sudo mkdir -p /usr/lib/x86_64-linux-gnu/security
sudo chown root:root /usr/lib/x86_64-linux-gnu/security
sudo chmod 755 /usr/lib/x86_64-linux-gnu/security

That leads to a different error:

FATAL ERROR:
Can't rename /lib: Permission denied at /usr/lib/usrmerge/convert-usrmerge line 286.

Running /usr/lib/usrmerge/convert-usrmerge again doesn't report that error anymore and was able to finish.

After that I was finally able to update the system again.

It did report the following though:

dpkg: warning: This system uses merged-usr-via-aliased-dirs, going behind dpkg's
dpkg: warning: back, breaking its core assumptions. This can cause silent file
dpkg: warning: overwrites and disappearances, and its general tools misbehavior.
dpkg: warning: See <https://wiki.debian.org/Teams/Dpkg/FAQ#broken-usrmerge>.

That suggests to run dpkg-fsys-usrunmess which seems to have cleaned everything up.

@bluca
Copy link
Member

bluca commented Jan 9, 2023

That suggests to run dpkg-fsys-usrunmess which seems to have cleaned everything up.

No, that further breaks it, it means you won't be able to upgrade to bookworm. Delete the image and install it from scratch.

@Biswa96
Copy link

Biswa96 commented Jan 9, 2023

Is it possible to use the Linux distribution in WSL2 instead of WSL1?

@firewave
Copy link

firewave commented Jan 9, 2023

No, that further breaks it, it means you won't be able to upgrade to bookworm. Delete the image and install it from scratch.

I am using Kali which is rolling so I am possibly already on a bookworm-ish state.

@Vebryn
Copy link

Vebryn commented Jun 23, 2023

A new upload to the store has been done by the maintainer, and the Debian image is now merged-usr by default. Users on WSL 1.0 can uninstall and reinstall to fix this problem.

Still not working, I remove my Debian image using wsl unregister then uninstall it from start menu. Then, I download new image from https://aka.ms/wsl-debian-gnulinux.

I got a fresh Debian 11. After editing sources.list and upgrade:

Preparing to unpack .../archives/usrmerge_35_all.deb ...
Unpacking usrmerge (35) ...
Setting up usrmerge (35) ...
mv: cannot move '/lib/x86_64-linux-gnu/security' to '/usr/lib/x86_64-linux-gnu/security': Permission denied

FATAL ERROR:
mv --no-clobber /lib/x86_64-linux-gnu/security /usr/lib/x86_64-linux-gnu/security: rc=1

You can try correcting the errors reported and running again
/usr/lib/usrmerge/convert-usrmerge until it will complete without errors.
Do not install or update other Debian packages until the program
has been run successfully.

E: usrmerge failed.
dpkg: error processing package usrmerge (--configure):
 installed usrmerge package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 usrmerge
E: Sub-process /usr/bin/dpkg returned an error code (1)

@seanthegeek
Copy link
Author

Is it possible to use the Linux distribution in WSL2 instead of WSL1?

Not in some cases. WSL2 requires Hyper-V. Some Virtual desktop systems like AWS WorkSpaces can't run a hypervisor like Hyper-V, because the system itself is a VM.

@zhangboyang
Copy link

Here is a pure WSL1 workaround: #4279 (comment)

Copy link
Contributor

This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants