Fix: Can’t exec «locale»: No such file or directory at /usr/share/perl5/Debconf/Encoding.pm


Проблема : при запуске действия install/revome в apt-get вылезает ошибка

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)

Решение достаточно простое

1) Выкачиваем пакет libc

apt-get download libc-bin

2) Разархивируем пакет в соответствии со своей архитектурой

dpkg -x libc-bin*.deb unpackdir

3) Копируем файлик в нужное место

cp unpackdir/sbin/ldconfig /sbin/

4) И тут же переустанвливает пакет
apt-get install --reinstall libc-bin
apt-get install -f