当我使用16.04的时候,我已经安装了基本的构建,并且在我的系统上安装了多个版本的gcc和g++,它们运行得很好。
在系统升级之后,它们显然还没有安装。
我尝试了一些解决方案,最常见的是使用智能,它建议恢复到旧版本,但我没有得到这个选项。正如您所看到的,它建议将所有内容保持在当前版本,甚至没有安装的包。
sudo aptitude install gcc
[sudo] password for ubuntu:
The following NEW packages will be installed:
cpp{a} cpp-9{ab} gcc gcc-9{ab} libasan5{ab} libatomic1{ab} libgcc-9-dev{ab} libisl21{a} libubsan1{ab}
0 packages upgraded, 9 newly installed, 0 to remove and 2 not upgraded.
Need to get 22.2 MB of archives. After unpacking 76.8 MB will be used.
The following packages have unmet dependencies:
cpp-9 : Depends: gcc-9-base (= 9.2.1-9ubuntu2) but 9.3.0-10ubuntu2~16.04 is installed
libasan5 : Depends: gcc-9-base (= 9.2.1-9ubuntu2) but 9.3.0-10ubuntu2~16.04 is installed
libubsan1 : Depends: gcc-9-base (= 9.2.1-9ubuntu2) but 9.3.0-10ubuntu2~16.04 is installed
gcc-9 : Depends: gcc-9-base (= 9.2.1-9ubuntu2) but 9.3.0-10ubuntu2~16.04 is installed
libatomic1 : Depends: gcc-9-base (= 9.2.1-9ubuntu2) but 9.3.0-10ubuntu2~16.04 is installed
libgcc-9-dev : Depends: gcc-9-base (= 9.2.1-9ubuntu2) but 9.3.0-10ubuntu2~16.04 is installed
open: 33; closed: 170; defer: 16; conflict: 25 .The following actions will resolve these dependencies:
Keep the following packages at their current version:
1) cpp [Not Installed]
2) cpp-9 [Not Installed]
3) gcc [Not Installed]
4) gcc-9 [Not Installed]
5) libasan5 [Not Installed]
6) libatomic1 [Not Installed]
7) libgcc-9-dev [Not Installed]
8) libubsan1 [Not Installed]
Accept this solution? [Y/n/q/?]发布于 2020-06-08 12:23:18
找到了一个对我有用的解决方案,这里。为了防止链接中断,解决方案是:
数据包损坏的问题出现在dpkg状态文件中。
$ sudo vim /var/lib/dpkg/status找到损坏的包,并删除有关它的整个信息块并保存该文件。在我的案例中,我删除了gcc-9相关的两段信息.在那之后我跑了
sudo aptitude install gcc这让我现在可以选择下调软件包的评级,从而解决了所有进一步的问题。
https://askubuntu.com/questions/1248173
复制相似问题