sudo apt-get -f install 出错(找不到 ldconfig)

end*_*ser 1 command-line apt directory software-installation 14.04

我正在使用 14.04 LTS。当我输入sudo apt-get -f install终端时,我收到此错误:

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)
Run Code Online (Sandbox Code Playgroud)

请帮忙,谢谢。


回应 Faizansudo dpkg-reconfigure -a在评论中说“尝试执行”。当我尝试时,我收到了这条消息:

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
Run Code Online (Sandbox Code Playgroud)

编辑:

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)
Run Code Online (Sandbox Code Playgroud)

JoK*_*KeR 6

如果它适合您,请尝试此解决方法。确保您尚未激活不同版本或预发布更新的不稳定存储库,但对于 14.04 LTS,建议仅检查 --> 系统设置/软件和更新。

然后运行:

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
Run Code Online (Sandbox Code Playgroud)

另一种方式:

libc-bin 在这里下载例如

然后你必须提取它:

dpkg -x libc-bin*.deb unpacked/
Run Code Online (Sandbox Code Playgroud)

将文件复制到系统:

sudo cp unpacked/sbin/ldconfig /sbin/
Run Code Online (Sandbox Code Playgroud)

或者使用以下命令打开 Nautilus:

gksudo nautilus
Run Code Online (Sandbox Code Playgroud)

并执行此 GUI 方式,右键单击.deb包并选择在此处提取并复制到目标位置。

进而:

sudo apt-get install --reinstall libc-bin

sudo apt-get install -f
Run Code Online (Sandbox Code Playgroud)