Ubuntu 上的损坏软件包!-无法删除或修复它

Ubuntu 上的损坏软件包!-无法删除或修复它

我有一个问题。我打开SYNAPTIC 软件包管理器并出现一条错误消息,告诉我有一个包装破损在我的系统上。我将修理它在终端上输入' sudo apt-get install -f' 然后终端会显示:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Correcting dependencies... Done
The following packages will be REMOVED:
   libc6-dev
0 upgraded, 0 newly installed, 1 to remove and 172 not upgraded.
1 not fully installed or removed.

After this operation, 13.7MB disk space will be freed.
Do you want to continue? [Y/n]? Y
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE: = (unset),
    LC_ALL = (unset),
    LANG = "el_GR.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.

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)

答案1

我不知道发生了什么,但让我们尝试满足 apt:

sudo mkdir -p /var/cache/apt/archives/partial
sudo chown root:root  /var/cache/apt/archives/partial
sudo chmod 755 /var/cache/apt/archives/partial
sudo apt-get update && sudo apt-get install -f

看看是否有效。

答案2

好的,首先,停止。每当你收到一个损坏的包裹时,在没有理解正在做什么的情况下发出命令,非常糟糕的想法。首先,让我们尽可能默认地安装:

sudo rename 's/\.list/\.list\.disable/' /etc/apt/sources.list.d/*.list
sudo mkdir -p /var/cache/apt/archives/partial
sudo apt-get update
sudo apt-get -f upgrade
sudo apt-get -f install libc6-dev

现在,让我们修复 perl 警告:

sudo locale-gen el_GR.UTF-8

然后让我们尝试使用apt-get -f install

sudo apt-get -f install

现在,不应该显示任何错误。

答案3

通过安装冲突的包,该问题已得到解决。

解决方案

手动下载并解压包

apt-get download conflicting-pakage
dpkg -x libc-bin*.deb unpackdir/

将文件复制到您的系统

sudo cp unpackdir/sbin/ldconfig /sbin/

确保包装和包装系统处于良好状态。

sudo apt-get install --reinstall conflicting-pakage
sudo apt-get install -f

原始来源请点击这里

相关内容