尝试安装依赖项时出现错误“Perl 可能未配置”

尝试安装依赖项时出现错误“Perl 可能未配置”

我是 ubuntu 新手,目前正在使用 ubuntu 17,正在尝试运行,sudo apt --fix-broken install因为我在顶部的网络指示器附近出现了一个红色错误信息

“发生错误,请从右键菜单运行包管理器或从终端运行 apt-get 查看错误原因。错误消息为:Error:brokenCount>0。这意味着您安装的依赖项有未满足的包”

当我运行时sudo apt --fix-broken install。一开始一切都运行正常,但是在某个时候,我收到了这个奇怪的错误。

Perl may be unconfigured (strict.pm did not return a true value at (eval 1) line 2.
BEGIN failed--compilation aborted at (eval 1) line 2. ) -- aborting
(Reading database ... 169172 files and directories currently installed
Preparing to unpack .../libc6_2.24-9ubuntu2_i386.deb ...
strict.pm did not return a true value at /usr/share/debconf/frontend line 5.
BEGIN failed--compilation aborted at /usr/share/debconf/frontend line 5.
dpkg: error processing archive /var/cache/apt/archives/libc6_2.24-9ubuntu2_i386.deb (--unpack):
subprocess new pre-installation script returned error exit status 5
Errors were encountered while processing:
/var/cache/apt/archives/libc6_2.24-9ubuntu2_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

我真的很困惑..提前谢谢

已编辑 每次我尝试安装任何程序时都会出现此错误。

You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
libbz2-1.0:i386 : Depends: libc6:i386 (>= 2.4) but it is not installed
libgcc1:i386 : Depends: libc6:i386 (>= 2.2.4) but it is not installed
libgpm2:i386 : Depends: libc6:i386 (>= 2.15) but it is not installed
libncurses5:i386 : Depends: libc6:i386 (>= 2.4) but it is not installed
libstdc++6:i386 : Depends: libc6:i386 (>= 2.18) but it is not installed
libtinfo5:i386 : Depends: libc6:i386 (>= 2.16) but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

答案1

这是一个非常常见的问题。我已回答过蒸汽谷歌浏览器。这是我对 Google Chrome 的回答的修改版本。

解决此问题的第一步是启用对 32 位二进制文​​件的支持。您可以通过运行

sudo dpkg --add-architecture i386 && sudo apt update 现在尝试再次安装 Google Chrome。

如果这仍然不起作用,请尝试手动安装软件包。

  1. 打开https://packages.ubuntu.com/在您的网络浏览器中。
  2. 向下滚动到搜索包目录区域。
  3. 从发行版下拉菜单中选择您的 Ubuntu 版本(您可以lsb_release -a在终端中运行找到它。使用该codename部分)。
  4. 输入包名称并单击搜索(本例中为 libgcc1)
  5. 单击“精确匹配”(本例中为 Package libgcc1)
  6. 在底部的表格中选择 i386
  7. 选择页面上的其中一个链接。选择适合您所在国家/地区的链接可能是一个好主意,但这并不重要。
  8. 打开终端并导航到您下载包的目录。
  9. 运行 sudo dpkg -i file.deb,其中 file.deb 是您刚刚下载的文件。完成后,尝试再次安装 Chrome。

如果它提示您依赖于其他软件包的错误,只需按照该软件包的步骤 1-9 操作,然后尝试再次安装 Chrome。您可能需要多次执行此操作。

相关内容