Debian 数据包修复 - 语言环境不起作用 - 无法安装数据包 - 库损坏

Debian 数据包修复 - 语言环境不起作用 - 无法安装数据包 - 库损坏

我做了一些可怕的事情,希望没有毁了我的 Debian 9 Strech...我在 Google 上搜索了大约 2 个小时来解决这个问题,但没有任何帮助...

我做了什么:我的 ClamAV 已经过时了,我手动将测试源添加到 /etc/apt/sources.list 并在终端中输入“apt-get install clamav”,现在一些库已损坏……此外,我再次删除了测试源并尝试恢复状态,但没有成功。命令建议使用“apt --fix-broken install”,我照做了。

现在看来我的语言环境已经完全消失了,一些库也是如此:每次我尝试升级/安装某些东西时,都会出现这种情况:

点击以获得更好的可读性(错误消息)

> apt-listchanges: Can't set locale; make sure $LC_* and $LANG are correct!
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
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.
Setting up linux-image-4.9.0-8-amd64 (4.9.144-3.1) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-4.9.0-8-amd64
WARNING: no ldd around - install libc-bin
update-initramfs: failed for /boot/initrd.img-4.9.0-8-amd64 with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-4.9.0-8-amd64 (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 linux-image-4.9.0-8-amd64
> 
> 

当我使用“sudo apt-get install --reinstall libc-bin”时收到的另一条错误消息

> 
> Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
> 
> The following packages have unmet dependencies:
 libc-bin : Depends: libc6 (< 2.25) but 2.28-6 is to be installed
E: Unable to correct problems, you have held broken packages.

(抱歉,这个命令行的引用太糟糕了,我想发布一张图片,但我还没有足够的声誉。我发布了一个链接,您可以在其中找到更好的可读版本。)

我尝试使用以下命令来修复此问题:

> sudo locale-gen "en_US.UTF-8"`
-> locale-gen: command not found
> 
> update-locale LANG=de_DE.UTF-8
-> update-locale: command not found

我也尝试遵循以下说明:https://itsfoss.com/fix-exec-locale-file-directory/

也没什么帮助。

我很沮丧,因为我没有可以恢复的备份。谢谢你的帮助

答案1

每当有人告诉你将不稳定或测试源添加到稳定系统上时,你应该别理他们并继续寻找其他选项。这是 Debian 系统崩溃的最常见原因。

也许可以使用 dist-upgrade 来修复系统。首先删除所有测试源,确保每个 apt 源都处于稳定状态(或者如果您正在运行旧稳定版本),然后:

apt-get update
apt-get dist-upgrade

正如 wurtel 在评论中所说,您还可以将所有源更改为测试,然后将 dist-upgrade 更改为测试。

但请记住,您的系统已严重损坏,这可能无法修复它,您的最后选择是重新安装操作系统。

相关内容