安装 gcc-multilib 时出现依赖错误

安装 gcc-multilib 时出现依赖错误

我目前尝试gcc-multilib在我的Ubuntu 16.04.4 LTS计算机上安装(刚刚完成apt-get update+ upgrade)。

有几个依赖项,这就是为什么我尝试使用它来aptitude自动解决它们。这是我当前的输出:

me@my_machine:~$ sudo aptitude install gcc-multilib
The following NEW packages will be installed:
  gcc-5-multilib{a} gcc-multilib{b} lib32asan2{a} lib32atomic1{a} lib32cilkrts5{a} lib32gcc-5-dev{a} lib32gomp1{a} lib32itm1{a} lib32mpx0{a} lib32quadmath0{a} lib32ubsan0{a} libc6-dev-i386{a} 
  libc6-dev-x32{a} libc6-x32{a} libx32asan2{a} libx32atomic1{a} libx32cilkrts5{a} libx32gcc-5-dev{a} libx32gcc1{ab} libx32gomp1{a} libx32itm1{a} libx32quadmath0{a} libx32stdc++6{a} libx32ubsan0{a} 
0 packages upgraded, 24 newly installed, 0 to remove and 0 not upgraded.
Need to get 11,1 MB of archives. After unpacking 46,2 MB will be used.
The following packages have unmet dependencies:
 libx32gcc1 : Depends: gcc-6-base (= 6.0.1-0ubuntu1) but 6.3.0-18ubuntu2~16.04 is installed.
 gcc-5-aarch64-linux-gnu : Conflicts: gcc-multilib but 4:5.3.1-1ubuntu1 is to be installed.
 gcc-multilib : Conflicts: gcc-5-aarch64-linux-gnu but 5.4.0-6ubuntu1~16.04.9cross1 is installed.
                Conflicts: gcc-5-aarch64-linux-gnu:i386 but it is not going to be installed.
The following actions will resolve these dependencies:

      Keep the following packages at their current version:
1)      gcc-5-multilib [Not Installed]                     
2)      gcc-multilib [Not Installed]                       
3)      lib32gcc-5-dev [Not Installed]                     
4)      libx32asan2 [Not Installed]                        
5)      libx32cilkrts5 [Not Installed]                     
6)      libx32gcc-5-dev [Not Installed]                    
7)      libx32gcc1 [Not Installed]                         
8)      libx32stdc++6 [Not Installed]                      
9)      libx32ubsan0 [Not Installed]                       

      Leave the following dependencies unresolved:         
10)     libc6-dev-i386 recommends gcc-multilib             


Accept this solution? [Y/n/q/?] Y
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.

看起来当前版本gcc-multilib需要比当前版本更旧的版本gcc-6-base,但它们都是 aptitude 可以找到的最新版本。

我当前的 gcc 版本如下 (gcc --version): gcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609。但我已经安装了最新的gcc-6-base

我有什么选择?降级是gcc-6-base完成安装的唯一选择吗?

是不是因为 gcc 的两个上游包不兼容,或者是我的机器有问题?

关于我的机器的更多细节:

uname -a
Linux huhuhu-UBUNTU 4.4.0-128-generic #154-Ubuntu SMP Fri May 25 14:15:18 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

回答评论(但我做了我的解决方案):

apt-cache policy gcc-6-base
gcc-6-base:
  Installed: 6.0.1-0ubuntu1
  Candidate: 6.0.1-0ubuntu1
  Version table:
 *** 6.0.1-0ubuntu1 500
        500 http://de.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
        100 /var/lib/dpkg/status

答案1

我成功安装了gcc-multilib,但一些组件降级了。不知道这是否是一个好的解决方案,但它确实有效。

我的解决方案是安装,当 aptitude 第一次询问“是否接受此解决方案?”时按下,第二次询问时gcc-5-multilib按下。输出:nY

sudo aptitude install gcc-5-multilib
...
The following actions will resolve these dependencies:

      Keep the following packages at their current version:
1)      gcc-5-multilib [Not Installed]                     
2)      gcc-multilib [Not Installed]                       
3)      lib32gcc-5-dev [Not Installed]                     
4)      libx32asan2 [Not Installed]                        
5)      libx32cilkrts5 [Not Installed]                     
6)      libx32gcc-5-dev [Not Installed]                    
7)      libx32gcc1 [Not Installed]                         
8)      libx32stdc++6 [Not Installed]                      
9)      libx32ubsan0 [Not Installed]                       

      Leave the following dependencies unresolved:         
10)     libc6-dev-i386 recommends gcc-multilib             


Accept this solution? [Y/n/q/?] n
The following actions will resolve these dependencies:

     Remove the following packages:                                       
1)     gcc-6-base:i386                                                    

     Keep the following packages at their current version:                
2)     gcc-multilib [Not Installed]                                       

     Downgrade the following packages:                                    
3)     gcc-6-base [6.3.0-18ubuntu2~16.04 (now) -> 6.0.1-0ubuntu1 (xenial)]

     Leave the following dependencies unresolved:                         
4)     libc6-dev-i386 recommends gcc-multilib                             


Accept this solution? [Y/n/q/?] Y
The following packages will be DOWNGRADED:
  gcc-6-base 
The following NEW packages will be installed:
  gcc-5-multilib lib32asan2{a} lib32atomic1{a} lib32cilkrts5{a} lib32gcc-5-dev{a} lib32gomp1{a} lib32itm1{a} lib32mpx0{a} lib32quadmath0{a} lib32ubsan0{a} libc6-dev-i386{a} libc6-dev-x32{a} 
  libc6-x32{a} libx32asan2{a} libx32atomic1{a} libx32cilkrts5{a} libx32gcc-5-dev{a} libx32gcc1{a} libx32gomp1{a} libx32itm1{a} libx32quadmath0{a} libx32stdc++6{a} libx32ubsan0{a} 
The following packages will be REMOVED:
  gcc-6-base:i386{a} 
The following packages are RECOMMENDED but will NOT be installed:
  gcc-multilib 
0 packages upgraded, 23 newly installed, 1 downgraded, 1 to remove and 0 not upgraded.
Need to get 11,1 MB of archives. After unpacking 46,1 MB will be used.
Do you want to continue? [Y/n/?] Y
...

之后我就可以安装gcc-multilib

sudo aptitude install gcc-multilib
The following NEW packages will be installed:
  gcc-multilib{b} 
0 packages upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 1.212 B of archives. After unpacking 8.192 B will be used.
The following packages have unmet dependencies:
 gcc-5-aarch64-linux-gnu : Conflicts: gcc-multilib but 4:5.3.1-1ubuntu1 is to be installed.
 gcc-multilib : Conflicts: gcc-5-aarch64-linux-gnu but 5.4.0-6ubuntu1~16.04.9cross1 is installed.
                Conflicts: gcc-5-aarch64-linux-gnu:i386 but it is not going to be installed.
The following actions will resolve these dependencies:

     Remove the following packages:
1)     gcc-5-aarch64-linux-gnu     
2)     gcc-aarch64-linux-gnu       



Accept this solution? [Y/n/q/?] Y
The following NEW packages will be installed:
  gcc-multilib 
The following packages will be REMOVED:
  binutils-aarch64-linux-gnu{u} cpp-5-aarch64-linux-gnu{u} cpp-aarch64-linux-gnu{u} gcc-5-aarch64-linux-gnu{a} gcc-5-aarch64-linux-gnu-base{u} gcc-5-cross-base{u} gcc-aarch64-linux-gnu{a} 
  libasan2-arm64-cross{u} libatomic1-arm64-cross{u} libc6-arm64-cross{u} libc6-dev-arm64-cross{u} libgcc-5-dev-arm64-cross{u} libgcc1-arm64-cross{u} libgomp1-arm64-cross{u} libitm1-arm64-cross{u} 
  libstdc++6-arm64-cross{u} libubsan0-arm64-cross{u} linux-libc-dev-arm64-cross{u} 
0 packages upgraded, 1 newly installed, 18 to remove and 0 not upgraded.
Need to get 1.212 B of archives. After unpacking 60,8 MB will be freed.
Do you want to continue? [Y/n/?] Y

相关内容