处理存档 /var/cache/apt/archives/libc6_2.27-3ubuntu1_amd64.deb 时出错

处理存档 /var/cache/apt/archives/libc6_2.27-3ubuntu1_amd64.deb 时出错

当我运行 sudo apt-get -f install 时,它显示 dpkg:错误处理。我还运行了sudo dpkg -i --force-overwrite /var/cache/apt/archives/libc6_2.27-3ubuntu1_amd64.deb

sudo dpkg -i --force-overwrite /var/cache/apt/archives/libc6_2.27- 
3ubuntu1_amd64.deb 
(Reading database ... 362976 files and directories currently 
installed.)
Preparing to unpack .../libc6_2.27-3ubuntu1_amd64.deb ...
dpkg: error processing archive /var/cache/apt/archives/libc6_2.27- 
3ubuntu1_amd64.deb (--install):
subprocess new pre-installation script returned error exit status 1
Processing triggers for libc-bin (2.23-0ubuntu10) ...
Errors were encountered while processing:
/var/cache/apt/archives/libc6_2.27-3ubuntu1_amd64.de

grep -r deb /etc/apt/sources.list /etc/apt/sources.list.d

/etc/apt/sources.list:deb http://archive.ubuntu.com/ubuntu bionic main restricted universe
/etc/apt/sources.list:deb http://archive.ubuntu.com/ubuntu bionic-updates main restricted universe
/etc/apt/sources.list:deb http://security.ubuntu.com/ubuntu bionic-security main restricted universe multiverse
/etc/apt/sources.list:deb http://archive.canonical.com/ubuntu bionic partner

apt-get -f install

Do you want to continue? [Y/n] Y
Extracting templates from packages: 100%
Preconfiguring packages ...
(Reading database ... 362976 files and directories currently installed.)
Preparing to unpack .../libc6_2.27-3ubuntu1_amd64.deb ...
dpkg: error processing archive /var/cache/apt/archives/libc6_2.27-3ubuntu1_amd64.deb (--unpack):
 subprocess new pre-installation script returned error exit status 1
Processing triggers for libc-bin (2.23-0ubuntu10) ...
Errors were encountered while processing:
 /var/cache/apt/archives/libc6_2.27-3ubuntu1_amd64.deb

回音apt-cache policy libc-bin

root@2wy:/etc/apache2/sites-enabled# apt-cache policy libc-bin
libc-bin:
  Installed: 2.23-0ubuntu10
  Candidate: 2.27-3ubuntu1
  Version table:
     2.27-3ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages
 *** 2.23-0ubuntu10 100
        100 /var/lib/dpkg/status

答案1

对我有用的是这两个命令:

sudo fuser -kv /var/cache/debconf/config.dat

进而

sudo apt --fix-broken install

fuser 命令是一个非常智能的 unix 实用程序,用于查找哪个进程正在使用文件、目录或套接字。它还提供有关拥有该进程的用户和访问类型的信息。fuser 工具显示使用指定文件或文件系统的每个进程的进程 ID (PID)。

  • k标志用于终止进程(--kill
  • v标志用于详细且清晰的输出(--verbose

参考: 数字海洋 科技薄荷 类似问题

答案2

我遇到了同样的问题。我已删除 中的所有文件,/usr/share/doc/libc6然后libc6从 中删除/usr/share/lintian/overrides/。终于sudo apt -f install解决了。

答案3

首先你可以尝试sudo apt upgrade libc-bin

根据软件包搜索,您的版本来自 xenial。

当问题无法通过这种方式解决时,请尝试sudo apt install --reinstall libc-bin=2.27-3ubuntu1

没有运气?wget -c http://mirrors.kernel.org/ubuntu/pool/main/g/glibc/libc-bin_2.27-3ubuntu1_amd64.deb绘制包并使用dpkg -i libc-bin_2.27-3ubuntu1_amd64.deb

相关内容