Fix “dpkg: warning: ‘ldconfig’ not found in PATH or not executable” in WSL
Fix “dpkg: warning: ‘ldconfig’ not found in PATH or not executable” in WSL
Windows Subsystem for Linux (WSL) is not short of problems, probably because it’s yet to be at its best. The errors FIXED in this article resulted from running a command to Fix Broken Packages both as NON-ROOT or ROOT and revolves around fixing a MISSING package, “ldconfig“;
sudo apt-get --fix-broken install apt-get --fix-broken install
Error::
dpkg: warning: 'ldconfig' not found in PATH or not executable dpkg: error: 1 expected program not found in PATH or not executable Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin E: Sub-process /usr/bin/dpkg returned an error code (2)
[SOLUTION]
FIRST step here was to download the package. However, the package “ldconfig” does not exist on its own as a package, but rather lives inside another package, namely “libc-bin“! Therefore we have to download “libc-bin” which can be done using the “apt-get” utility;
sudo apt-get download libc-bin
NEXT step was to EXTRACT the contents of the Debian (.deb) package to the current working directory (and hence ./), then confirming the contents were in fact extracted (using “ls”);
sudo dpkg --extract ./libc-bin_2.34-4_amd64.deb ./ ls
NEXT step was to COPY the package “ldconfig” to its rightful location (using “cp“), then REINSTALL the “libc-bin” package;
sudo cp ./sbin/ldconfig /sbin/ sudo apt-get install --reinstall libc-bin
NEXT step was to fix any broken dependencies (using “apt-get“);
sudo apt-get install -f
[Proof of Concept (PoC)]
To confirm that the initial Error was successfully FIXED, run the command that threw the exception!
sudo apt-get --fix-broken install
Fix “dpkg: warning: ‘ldconfig’ not found in PATH or not executable” in WSL
Forum [ WSL ] | thetqweb