ubuntu报错解决:The following packages have unmet dependencies:

我安装了全新的ubuntu,然后安装软件时报错了:

root@ubuntu:/home/zhang# apt install g++
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:
 g++ : Depends: g++-5 (>= 5.3.1-3~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

我很奇怪,毕竟是全新的系统,为什么会报这个错。然后我想起了之前替换了更新源,可能是更新源换错了。我去看,发现更新源果然换错了,我把ubuntu 16.04的更新源给我这台ubuntu18.04用。
把更新源修改后就没问题了。

你可能感兴趣的:(linux,行走的问题解决机)