Error with sudo apt-get -f install (ldconfig not found)
17,056
Try this workaround if it works for you. Make sure you have not activated unstable repos for different releases or pre-released updates but for 14.04 LTS recommended only check in --> system settings/software & updates.
then run:
sudo apt-get -f install
sudo dpkg-reconfigure libc6
sudo dpkg-reconfigure libc-bin
sudo apt-get install --reinstall libc6
sudo apt-get install --reinstall libc-bin
sudo apt-get dist-upgrade
Other way:
Download libc-bin
here e.g.
Then you'll have to extract it:
dpkg -x libc-bin*.deb unpacked/
copy the files to system:
sudo cp unpacked/sbin/ldconfig /sbin/
Or open Nautilus with:
gksudo nautilus
and do this GUI way, right click on a .deb
package and choose extract here and copy to destination place.
And then:
sudo apt-get install --reinstall libc-bin
sudo apt-get install -f
Related videos on Youtube
Comments
-
enduser over 1 year
I am using 14.04 LTS. When I type
sudo apt-get -f install
into the terminal I get this error:Can't exec "locale": No such file or directory at /usr/share/perl5/Debconf/Encoding.pm line 16. Use of uninitialized value $Debconf::Encoding::charmap in scalar chomp at /usr/share/perl5/Debconf/Encoding.pm line 17. 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)
Please help, thanks.
In response to Faizan who said "try executing
sudo dpkg-reconfigure -a
" in comments. When I tried that I got this message:Can't exec "locale": No such file or directory at /usr/share/perl5/Debconf/Encoding.pm line 16. Use of uninitialized value $Debconf::Encoding::charmap in scalar chomp at /usr/share/perl5/Debconf/Encoding.pm line 17. acpid stop/waiting acpid start/running, process 11426 /var/lib/dpkg/info/activity-log-manager.postinst: 5: /var/lib/dpkg/info/activity-log-manager.postinst: ldconfig: not found
Edit:
Can't exec "locale": No such file or directory at /usr/share/perl5/Debconf/Encoding.pm line 16. Use of uninitialized value $Debconf::Encoding::charmap in scalar chomp at /usr/share/perl5/Debconf/Encoding.pm line 17. 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)
-
Jos about 9 yearsI found a couple of related questions e.g. here. Could you try
sudo su
and thenapt-get -f install
as root? -
enduser about 9 yearsStill doesn't work, sorry.
-
Faizan Akram Dar about 9 yearstry executing
sudo dpkg-reconfigure -a
-
enduser about 9 yearsDidn't work either, message returned in edit above.
-
JoKeR about 9 yearswhen this started to happen? it seems like you got unstable repos activated or from other uncompatible release.
-
enduser about 9 yearsI am not sure when this stated to happen. I foolishly downloaded multiple packages without really thinking. Is there a way I can have a look at all the repos I disable the latest one or something like that?
-
-
enduser about 9 yearsStill won't work, sorry.
-
enduser about 9 yearsIt's saying the files don't exist.
-
JoKeR about 9 yearscan you show me the output for
apt-cache policy libc-bin
-
enduser about 9 yearsSorry it's an image, I couldn't format it on the site. imgur.com/kpipX5d
-
JoKeR about 9 yearsok and you have to install it like it says in my answer if you don't have it at all. Did you do so? And when you have installed it also do
apt-cache policy libc6
it has to be installed also. -
enduser about 9 yearswhen I do sudo apt-get -f install it comes up with the first error in the my question. When I try to reconfigure the files in step 2 & 3 it says those files do not exist.
-
JoKeR about 9 yearsrun
sudo apt-get install libc-bin
and show me the output please -
enduser about 9 yearsE: Sub-process /usr/bin/dpkg returned an error code (2)
-
enduser about 9 yearsFull message in EDIT 2.
-
enduser about 9 yearsI can't install a package installer because each time I try to install something it comes up with the unmet dependencies error. When I just open it Ubuntu Software Centre it says it cannot install because of a problem with software currently installed. It tries, and fails, to repair the current software.
-
JoKeR about 9 yearscheck my updated answer
-
JoKeR about 9 yearsI'm glad we solved this. Good luck!