WSL: libc-bin update error
Please use the following bug reporting template to help produce issues which are actionable and reproducible, including all command-line steps necessary to induce the failure condition. Please fill out all the fields! Issues with missing or incomplete issue templates will be closed.
If this is a console issue (a problem with layout, rendering, colors, etc.), please post to the console issue tracker.
Important: Do not open GitHub issues for Windows crashes (BSODs) or security issues. Please direct all Windows crashes and security issues to secure@microsoft.com. Ideally, please configure your machine to capture minidumps, repro the issue, and send the minidump from "C:\Windows\minidump".\
See our contributing instructions for assistance.
Please fill out the below information:
-
Your Windows build number: (Type
verat a Windows Command Prompt) Microsoft Windows [Version 10.0.18363.535] -
What you’re doing and what’s happening: (Copy&paste the full set of specific command-line steps necessary to reproduce the behavior, and their output. Include screen shots if that helps demonstrate the problem.) sudo apt-get update; sudo apt-get dist-upgrade
-
What’s wrong / what should be happening instead: libc-bin update fails with errors (maybe a Canonical problem, not sure) Only solution I know of at this point is to reset the app and reinstall everything into Ubuntu WSL so I can do apt-get updates in the future.
Copy paste what is on my screen:
sudo apt-get dist-upgrade
Reading package lists… Done
Building dependency tree
Reading state information… Done
Calculating upgrade… Done
The following packages will be upgraded:
dmeventd dmsetup libdevmapper-event1.02.1 libdevmapper1.02.1 liblvm2app2.2 liblvm2cmd2.02 lvm2
7 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/2191 kB of archives.
After this operation, 2048 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up libc-bin (2.27-3ubuntu1) …
Aborted (core dumped)
/sbin/ldconfig.real: Can’t stat /usr/local/lib/x86_64-linux-gnu: No such file or directory
/sbin/ldconfig.real: Path /lib/x86_64-linux-gnu' given more than once /sbin/ldconfig.real: Path /usr/lib/x86_64-linux-gnu’ given more than once
/usr/local/lib:
/lib/x86_64-linux-gnu:
Aborted (core dumped)
dpkg: error processing package libc-bin (–configure):
installed libc-bin package post-installation script subprocess returned error exit status 134
Errors were encountered while processing:
libc-bin
E: Sub-process /usr/bin/dpkg returned an error code (1)
-
Strace of the failing command, if applicable: (If
some_commandis failing, then runstrace -o some_command.strace -f some_command some_args, and link the contents ofsome_command.stracein a gist here). -
For WSL launch issues, please collect detailed logs.

About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 20
- Comments: 81
Commits related to this issue
- remove arm64 until get fixed. See https://github.com/microsoft/WSL/issues/4760 — committed to dappnode/DAppNodePackage-gnosis-beacon-chain-prysm by pablomendezroyo 5 years ago
This fix my problem 👍 :+1 if this working for you.
To my absolute shock and amazement, this is indeed the solution. Except for one caveat:
ls -alhdidn’t quite cut it. Instead, this is what worked for me:for PROBDIR in "" "/usr" "/usr/local"; do find "${PROBDIR}/lib/x86_64-linux-gnu" -type f -ls; done;Not in my case. I used:
Faced similar problem on Kali Linux, this helped:
This worked for me
It does not stop it from happening but when it does I ruin this little script i found on another post. It allows it to set back up and work. So every time it bonks out i run “fixme” shell script as follows.
It works for me. Someone a while ago posted it here, it is not my script, I just use it (a lot).
in my win10 20H2 19042 worked
I have recently run into this problem. The solution for my case turns out to be surprisingly easy: for each
Can't stat, manually runlsthat directory, and then run the sameaptagain.I had the issue today.
Could not install anything else because apt is trying to fix the installation of libc-bin. I tried the above instructions, but it failed at the reinstallation of libc-bin, so now there is no more libc, ldconfig, or anything else to get the system working.
I had to completely reinstall the WSL distribution.
This issue should not be closed.
That fail (particularly the segfault) is all in userspace so there is (unfortunately) no WSL actionable. Standard operating procedure is doing various
aptrain dances of questionable efficacy and reinstall when all else fails. Hat tip for the ubuntu forum link above.I believe this is the same issue, no answer here. apt not working: installed libc-bin package post-installation script subprocess returned error exit status 134
Finally I solved this by uninstalling ubuntu of WLS.
I reboot the computer,but the problem just still there
Since it’s buried so far down I’m requoting it - had this issue today randomly on debian testing, this was the only solution that worked!
As other comments said, try these things:
all methods above would cause errors below (I only found this problem on wsl ubuntu18 version)
This happened to me after trying to install nmap on WSL. In my case, ldconfig was segfaulting (choking on libpcap) and causing libc-bin to appear broken. I’ll provide my troubleshooting journey since yours will likely be slightly different:
Attempting to run ldconfig yielded the following:
Well, OK. Let’s uninstall nmap and try again:
That looks promising. Let’s see which of its dependencies might be naughty:
Those all look fairly innocuous with the exception of libpcap. Let’s see if it’s dropped anything in that path ldconfig was complaining about:
Right then. Out they go!
And all was well. You probably don’t need to reinstall libc-bin unless you (like me) casually delete system files in the process of troubleshooting. Don’t forget to clean up after that partially removed package:
tl;dr: Some libs apparently break ldconfig. Manually remove the offending library and clean up the mess. In my case it was libpcap0.8.
It works. Thank you
FINALLY this was the first one out of countless error 134 thanks
I solved this by sudo apt autoremove .
Solved by running:
If you encounter the following error:
Then run:
This is
ldconfigthat dumps core.ldconfig -vand then listing directory (ls) after which core is dumped is a workaround. You might need multiple iterations ofldconfig -vandlsThis fixed it, thanks!
it’s fixed on my side by 👍
sudo mv /var/lib/dpkg/info/libc-bin.* /tmp/ sudo apt install libc-binI just ran “sudo mv /var/lib/dpkg/info/libc-bin.* /tmp/” and apt-get update subsequently to fix this issue.
Can’t say I understood the issue but went on a limb and did the following that fixed the issue.
ln -s /usr/lib/x86_64-linux-gnu/ /usr/bin/x86_64-linux-gnu
Thanks, it worked for me too with WSL1 and Debian 10 on Windows 20H2
Well, it just happened again, and wsl.exe --shutdown did not fix it. For what it’s worth. Why does this happen to me and almost no one else? Is no one else even trying to update their Ubuntu WSL on a regular basis? I imagine they would want to do so, for security fixes if nothing else.
Probably not, narrowly speaking. I imagine the problem, educated guess, applies to any Debian based distro (ubuntu or otherwise). Whatever (scary quote) “the problem” is/was. Once a distro is hooped down at the
ldconfigandlibcsystem layer that’s a deep hole to climb out of. It is almost certainly possible to recover without resorting to a reinstall (because anything possible), but likely you would be chasing diminishing returns in the effort. Note you can get the equivalent of a reboot with awsl.exe --shutdownif you (or anyone else) bangs on it further. You don’t need to resort to the red button. Bonne chance.This fix my problem 👍 :+1 if this working for you.
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes -c yeshttps://github.com/docker/buildx/issues/1170#issuecomment-1159350550
On WSL2/Ubuntu 20.04 updating for the first time in like a year; the below let other packages update but left libc-bin as “not fully installed” and apt would try to install libc-bin, and print ldconfig messages and crash “Aborted (core dumped)”, if you try to install anything else or do apt autoremove.
Running
sudo ldconfigcrashed “Aborted (core dumped)”.Updating ldconfig cache while ignoring /var/cache/ldconfig/aux-cache fixed it for me. (I didn’t have the foresight to backup the binary aux-cache file so it could be attached to a bug report about ldconfig somewhere.) source
Solution:
Edit: Actually ignoring/removing aux-cache was mentioned early in the thread.
I have this issue pop up on me every now and then. Just made this a bash script and run it when it happens. Fixes every time. I just have to remember I have that script when it happens lol.
Not solving it for me
The following solution fixed my issue:
Fixed issue on my WSL2 Ubuntu-20.04
December 2020, Debian 10 (Buster) on WSL2, this was the only solution that worked for me.
This is not working, as the system is not allowing to remove the libc-bin Getting below error:
dpkg: error processing package libc-bin (–remove): this is an essential package; it should not be removed Errors were encountered while processing: libc-bin
dpkg: error processing package libc-bin (–purge): this is an essential package; it should not be removed Errors were encountered while processing: libc-bin
Try: sudo apt-get --fix-broken install
I want to confirm tha this worked for me on Ubuntu-20.04. One note only is that I needed to execute command multiple times (3-4) untill problem was resolved.
Thank you for your help.
Just sudo apt install libc-bin did the trick - problem solved. Thanks! P.S. Removing the package didn’t work - for each I got an error “this is an essential package; it should not be removed”
This fixed it for me (thanks @SkyLeach for the first part):
This worked for me on WSL2, Ubuntu 20.04… not sure what broke libc, ldconfig was segfaulting
Worked for me.