'/sbin/ldconfig.real: Can't stat /lib/x86_64-linux-gnu

When I run ldconfig on my Ubuntu box, I get the warning:

/sbin/ldconfig.real: Can't stat /lib/x86_64-linux-gnu

This is not causing any problems yet AFAIK, but I want to 'fix' it, incase it comes back to bite me later on. Does anyone know why I am getting this message - and how do I fix it?



Solution 1:[1]

I had the same issue, and I believe this is intended to be a directory location for Multiarch support. See file /etc/ld.so.conf.d/x86_64-linux-gnu.conf.

The way I got the error to go away was to create the directory, as it did not exist in my machine. I ran this as root:

mkdir /lib/x86_64-linux-gnu

Solution 2:[2]

A similar error occurred now on Debian 11 under WSL2. The fix was to create the directory in /usr/local/lib, as mentioned by Miguel Gualdron (sorry, can't comment, and maybe it's better to have this as info for Debian too). The full error message is below.

Setting up libc-bin (2.31-13+deb11u2) ...
Aborted (core dumped)
ldconfig: Can't stat /usr/local/lib/x86_64-linux-gnu: No such file or directory
ldconfig: Path `/lib/x86_64-linux-gnu' given more than once
ldconfig: Path `/usr/lib/x86_64-linux-gnu' given more than once
/usr/lib/wsl/lib:
/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)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Miguel Gualdron
Solution 2 Boyan Alexiev