Ubuntu18.04克服安装gcc的依赖问题 Ubuntu18.04安装gcc报依赖错误: The following packages have unmet dependencies: gcc : Depends: gcc-7 (>= 7.3.0-12~) but it is not going to be installed Recommends: libc6-dev but it is not going to be installed or libc-dev 查了DS,直接安装gcc-7也不好使, The following packages have unmet dependencies: gcc-7 : Depends: cpp-7 (= 7.3.0-16ubuntu3) but 7.5.0-3ubuntu1~18.04 is to be installed Depends: gcc-7-base (= 7.3.0-16ubuntu3) but 7.5.0-3ubuntu1~18.04 is to be installed Depends: libgcc-7-dev (= 7.3.0-16ubuntu3) but it is not going to be installed Recommends: libc6-dev (>= 2.13-0ubuntu6) but it is not going to be installed 最后采用安装aptitude的方法来解决。 不过aptitude没用过,输出的结果还搞不清楚。aptitude一开始给出的方案是Not installed, Keep the following packages at their current version: 1) gcc [Not Installed] 2) gcc-7 [Not Installed] 我还以为会自动安装,就按Y了,结果gcc并没有安装。 搞了几次后,发现要按n,aptitude就会给出新的方案: Downgrade the following packages: 1) cpp [4:7.4.0-1ubuntu2.3 (now) -> 4:7.3.0-3ubuntu2 (bionic)] 2) cpp-7 [7.5.0-3ubuntu1~18.04 (now) -> 7.3.0-16ubuntu3 (bionic)] ...... 这套方案按Y以后,就安装好gcc了。 总之,以后依赖有问题,由多了一种解决方案。 |
----------------------------------------------

|