无法一次安装两个软件包

无法一次安装两个软件包

我可以分别安装两个软件包,但是每当我尝试一次性安装它们时,我都会被告知它们具有“未满足的依赖关系”。

这是新鲜的安装 Ubuntu(trusty 和 bionic),因此不应该处于损坏状态。

这可行(但我确实需要一次性安装它们):

apt-get install gcc-multilib -y && apt-get install gcc-aarch64-linux-gnu -y && echo "Works!
[...]
Works!

失败了:

apt-get install gcc-aarch64-linux-gnu gcc-multilib -y

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 gcc-aarch64-linux-gnu : Depends: gcc-7-aarch64-linux-gnu (>= 7.3.0-12~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

输出自aptitude

aptitude install gcc-aarch64-linux-gnu gcc-multilib
The following NEW packages will be installed:
  binutils{a} binutils-aarch64-linux-gnu{a} binutils-common{a} binutils-x86-64-linux-gnu{a} cpp{a} cpp-7{a} 
  cpp-7-aarch64-linux-gnu{a} cpp-aarch64-linux-gnu{a} gcc{a} gcc-7{a} gcc-7-aarch64-linux-gnu{ab} 
  gcc-7-aarch64-linux-gnu-base{a} gcc-7-base{a} gcc-7-cross-base{a} gcc-7-multilib{a} gcc-8-cross-base{a} 
  gcc-aarch64-linux-gnu gcc-multilib{b} lib32asan4{a} lib32atomic1{a} lib32cilkrts5{a} lib32gcc-7-dev{a} 
  lib32gcc1{a} lib32gomp1{a} lib32itm1{a} lib32mpx2{a} lib32quadmath0{a} lib32stdc++6{a} lib32ubsan0{a} libasan4{a} 
  libasan4-arm64-cross{a} libatomic1{a} libatomic1-arm64-cross{a} libbinutils{a} libc-dev-bin{a} 
  libc6-arm64-cross{a} libc6-dev{a} libc6-dev-arm64-cross{a} libc6-dev-i386{a} libc6-dev-x32{a} libc6-i386{a} 
  libc6-x32{a} libcc1-0{a} libcilkrts5{a} libgcc-7-dev{a} libgcc-7-dev-arm64-cross{a} libgcc1-arm64-cross{a} 
  libgomp1{a} libgomp1-arm64-cross{a} libisl19{a} libitm1{a} libitm1-arm64-cross{a} liblsan0{a} 
  liblsan0-arm64-cross{a} libmpc3{a} libmpfr6{a} libmpx2{a} libquadmath0{a} libstdc++6-arm64-cross{a} libtsan0{a} 
  libtsan0-arm64-cross{a} libubsan0{a} libubsan0-arm64-cross{a} libx32asan4{a} libx32atomic1{a} libx32cilkrts5{a} 
  libx32gcc-7-dev{a} libx32gcc1{a} libx32gomp1{a} libx32itm1{a} libx32quadmath0{a} libx32stdc++6{a} libx32ubsan0{a} 
  linux-libc-dev{a} linux-libc-dev-arm64-cross{a} manpages{a} manpages-dev{a} 
0 packages upgraded, 77 newly installed, 0 to remove and 0 not upgraded.
Need to get 65.6 MB of archives. After unpacking 267 MB will be used.
The following packages have unmet dependencies:
 gcc-multilib : Conflicts: gcc-7-aarch64-linux-gnu but 7.3.0-16ubuntu3cross1 is to be installed
 gcc-7-aarch64-linux-gnu : Conflicts: gcc-multilib but 4:7.3.0-3ubuntu2 is to be installed
The following actions will resolve these dependencies:

     Keep the following packages at their current version:
1)     gcc-7-aarch64-linux-gnu [Not Installed]            
2)     gcc-aarch64-linux-gnu [Not Installed]              



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

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

     Leave the following dependencies unresolved:         
2)     libc6-dev-i386 recommends gcc-multilib             
3)     libc6-dev-x32 recommends gcc-multilib              



Accept this solution? [Y/n/q/?] q
Abandoning all efforts to resolve these dependencies.
Abort.

答案1

看起来你只是在请求一个不可能的情况,正如这里暗示的那样:

The following packages have unmet dependencies:

 gcc-multilib : Conflicts: gcc-7-aarch64-linux-gnu but 7.3.0-16ubuntu3cross1 is to be installed
 gcc-7-aarch64-linux-gnu : Conflicts: gcc-multilib but 4:7.3.0-3ubuntu2 is to be installed

换句话说,这些软件包相互冲突。您不能将它们一起安装。如果您独立执行这两个操作,则它会起作用,因为第二个操作将撤消第一个操作。

相关内容