1

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)
6
  • I found a couple of related questions e.g. here. Could you try sudo su and then apt-get -f install as root?
    – Jos
    Mar 30, 2015 at 15:41
  • Still doesn't work, sorry.
    – enduser
    Mar 30, 2015 at 16:03
  • try executing sudo dpkg-reconfigure -a Mar 30, 2015 at 16:14
  • Didn't work either, message returned in edit above.
    – enduser
    Mar 30, 2015 at 16:19
  • when this started to happen? it seems like you got unstable repos activated or from other uncompatible release.
    – JoKeR
    Mar 30, 2015 at 16:58

1 Answer 1

6

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
12
  • Still won't work, sorry.
    – enduser
    Mar 30, 2015 at 17:52
  • It's saying the files don't exist.
    – enduser
    Mar 30, 2015 at 17:52
  • can you show me the output for apt-cache policy libc-bin
    – JoKeR
    Mar 30, 2015 at 18:02
  • Sorry it's an image, I couldn't format it on the site. imgur.com/kpipX5d
    – enduser
    Mar 30, 2015 at 18:22
  • ok 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.
    – JoKeR
    Mar 30, 2015 at 18:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .