【问题标题】:apt-get error: Sub-process /usr/bin/dpkg returned an error code (1)apt-get 错误:子进程 /usr/bin/dpkg 返回错误代码 (1)
【发布时间】:2015-08-21 01:11:45
【问题描述】:

我在 apt-get install 中有错误 这是一个错误:

The following packages have unmet dependencies:
 gcc-4.8-multilib : Depends: libc6-dev-i386 (>= 2.11) but it is not going to be installed
 libc6-dev-x32 : Depends: libc6-dev-i386 (= 2.19-0ubuntu6.6) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

我尝试了几个命令 比如:apt-get -f install 轻松搞定

我尝试更改我的源列表,并重新制作 apt-get update

$ sudo apt-get install g++
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 gcc-4.8-multilib : Depends: libc6-dev-i386 (>= 2.11) but it is not going to be installed
 libc6-dev-x32 : Depends: libc6-dev-i386 (= 2.19-0ubuntu6.6) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

在 apt-get -f 中安装

$ sudo apt-get -f install 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
  libc6-dev-i386
The following NEW packages will be installed:
  libc6-dev-i386
0 upgraded, 1 newly installed, 0 to remove and 434 not upgraded.
3 not fully installed or removed.
Need to get 0 B/1.148 kB of archives.
After this operation, 6.333 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
(Reading database ... 194963 files and directories currently installed.)
Preparing to unpack .../libc6-dev-i386_2.19-0ubuntu6.6_amd64.deb ...
Unpacking libc6-dev-i386 (2.19-0ubuntu6.6) ...
dpkg: error processing archive /var/cache/apt/archives/libc6-dev-i386_2.19-0ubuntu6.6_amd64.deb (--unpack):
 trying to overwrite '/usr/include/bits', which is also in package libc6-dev-amd64 2.19-0ubuntu6.6
Errors were encountered while processing:
 /var/cache/apt/archives/libc6-dev-i386_2.19-0ubuntu6.6_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

【问题讨论】:

  • 您可以在askubuntu.com找到更多帮助。
  • 您使用不稳定或测试存储库吗?如果是,请手动定义:apt-get -t unstable install ...

标签: linux ubuntu apt-get


【解决方案1】:

您似乎已经安装了libc6-dev-amd64,并且您正在尝试安装依赖于libc6-dev-i386 的软件包,而这两者存在冲突(它们都包含/usr/include/bits) .

我猜你不希望同时安装这两个。我会使用apt-get remove libc6-dev-amd64 让自己恢复良好状态,然后再次尝试安装所需的软件包。

如果这两个包在同时安装时可以工作,那么请向包维护者提交错误,因为他们需要修复包以允许这样做。

【讨论】:

  • 我尝试删除软件包,但我遇到了与尝试安装 g++ 时相同的错误
【解决方案2】:

试试这个。打开一个新的终端并粘贴它

sudo dpkg -i --force-overwrite  /var/cache/apt/archives/libc6-dev-i386_2.19-0ubuntu6.6_amd64.deb

在那个类型之后:

sudo apt-get autoremove

最后输入

sudo apt-get update

希望您的问题能够得到解决。

【讨论】:

    【解决方案3】:

    终端尝试以下步骤:

     sudo apt-get --purge remove libc6-dev-amd64 
    
     sudo apt-get -f install
    
     sudo apt-get update
    

    希望这能解决您的问题。

    【讨论】:

    • E: 无法定位软件包 libc6-dev-amd64
    【解决方案4】:

    你可以用这个命令解决这个问题:

     sudo apt-get remove --purge libreoffice-core libreoffice-common
    python3-uno libreoffice-*
    

    【讨论】:

    • 在任何人尝试这样的命令之前,请确保您检查在此过程中还会删除哪些内容,如果您不喜欢正在删除的内容,请说不。您可以一次清除 1 个内容。并不是说这是错误的,但这些答案可能会搞砸系统。
    【解决方案5】:

    我能找到的解决方案都没有解决我的问题...仍然损坏包,无论自动删除,-f install ...等等。

    玩了一会后,以下为我解决了:

    sudo apt-get --purge remove libc6-dev-i386 libc6-dev-x32 gcc-5-multilib gcc-multilib
    
    sudo apt autoremove -f
    
    sudo apt-get -f install
    

    【讨论】:

      【解决方案6】:

      卸载时也可能出现同样的dpkg错误:

      apt-get uninstall
      

      apt-get purge
      

      首先,卸载软件包:

      rm -f /var/lib/dpkg/info/<package-name>*
      apt-get purge <package-name>
      

      之后你可以重新安装它:

      apt-get install <package-name>
      

      【讨论】:

        【解决方案7】:

        尝试是重新配置包数据库。安装软件包时数据库可能已损坏。 sudo dpkg --configure -a

        【讨论】:

          【解决方案8】:

          在 Ubuntu 18.04.3(使用 Linux 内核版本 5.7.14)中运行升级命令 (sudo apt-get upgrade -y) 时,会报告以下错误(红色):

          ... bind /var/run/spice-vdagentd/spice-vdagent-sock: No such file or directory
          ... Fatal could not create server socket /var/run/spice-vdagentd/spice-vdagent-sock
          ...
          ... Failed to start Agent daemon for Spice guests.
          

          以下步骤解决了该问题:

          1. 如果spice-vdagentd 目录不存在,则创建它:
          > sudo mkdir /var/run/spice-vdagentd (if it does not exist)
          
          1. 打开一个新文件spice-vdagent-sock
          > sudo vi /var/run/spice-vdagentd/spice-vdagent-sock
          
          1. 通过运行保存文件::wq
          2. 重新运行upgrade 命令以验证问题是否已解决。

          【讨论】:

            【解决方案9】:

            使用以下步骤我的问题在“Oracle VM VirtualBox Manager”中解决

            1. 自动删除

            2. apt purge libreoffice-base libreoffice-core

            3. dpkg -l "libreoffice" | grep "^ii"

            4. sudo dpkg --configure -a

            5. sudo apt-get install -f

            现在您可以尝试安装 - pip3 install jupyter 等。

            【讨论】:

              猜你喜欢
              • 1970-01-01
              • 1970-01-01
              • 1970-01-01
              • 1970-01-01
              • 1970-01-01
              • 2018-07-19
              • 2020-01-29
              • 1970-01-01
              • 2022-07-17
              相关资源
              最近更新 更多