Debian

“aptitude -f install”失敗

  • August 19, 2010

使用 debian lenny 並嘗試執行“aptitude -f install”

我收到此錯誤消息:

Can't exec "locale": No such file or directory at /usr/share/perl5/Debconf/Encod           ing.pm line 16.
Use of uninitialized value $Debconf::Encoding::charmap in scalar chomp at /usr/s           hare/perl5/Debconf/Encoding.pm line 17.
dpkg: `ldconfig' not found on PATH.
dpkg: 1 expected program(s) not found on PATH.
NB: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin.
E: Sub-process /usr/bin/dpkg returned an error code (2)
A package failed to install.  Trying to recover:
dpkg: `ldconfig' not found on PATH.

更新 我設法更進一步。新的錯誤資訊是

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.
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Reading task descriptions... Done

所以至少 ldconfig 回來了。

** 更新 2 **

最新的錯誤資訊:

unknown initscript, /etc/init.d/glibc.sh not found.

到達那裡…一步一個腳印 你們中有人知道為什麼以及如何修復它嗎?

如果您以 root 身份執行此操作,並且您在 root 的路徑中有 /sbin、/usr/sbin 和 /usr/local/sbin,您可能需要這樣做

 apt-get --reinstall install libc6

從頭刷新你的 libc 包並重新安裝一些損壞或失去的二進製文件。

語言環境設置有點棘手。確保你已經安裝了“locales”包,也許還安裝了“locales-all”包。您也可以嘗試(以 root 身份):

dpkg-reconfigure libc6

引用自:https://serverfault.com/questions/172350