参考链接:
[解决 The following packages have unmet dependencies: 问题] https://blog.csdn.net/jqw11/article/details/93063985
更新:
Ubuntu18.04 系统安装 g++ 依然出错,把 Ubuntu18.04 系统升级至 Ubuntu20.04 以后,问题都神奇地解决了。
![](https://img.haomeiwen.com/i14017479/352a3f806cbffed7.png)
ploso@ploso-ThinkPad-T420:~$ sudo apt-get -y install g++-8
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++-8 : Depends: libstdc++-8-dev (= 8.4.0-1ubuntu1~18.04) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
$ sudo apt-get install libstdc++-8-dev = 8.4.0-1ubuntu1~18.04
Readingpackagelists... Done
Building dependency tree
Reading state information... Done
Thefollowingpackages will be DOWNGRADED:
libfreetype6
0upgraded,0newly installed,1downgraded,0toremoveand2notupgraded.
Needtoget316kBofarchives.
Afterthis operation,0Bofadditional diskspacewill be used.
Doyou wanttocontinue? [Y/n] y
Get:1http://archive.ubuntu.com/ubuntu xenial/mainamd64 libfreetype6 amd642.6.1-0.1ubuntu2 [316kB]
Fetched316kBin2s (119kB/s)
dpkg:warning: downgrading libfreetype6:amd64from2.6.1-0.1ubuntu2.3to2.6.1-0.1ubuntu2
(Readingdatabase...311069filesanddirectories currently installed.)
Preparingtounpack .../libfreetype6_2.6.1-0.1ubuntu2_amd64.deb ...
Unpacking libfreetype6:amd64 (2.6.1-0.1ubuntu2)over(2.6.1-0.1ubuntu2.3) ...
Processingtriggersforlibc-bin(2.23-0ubuntu11) ...
Setting up libfreetype6:amd64 (2.6.1-0.1ubuntu2) ...
Processingtriggersforlibc-bin(2.23-0ubuntu11) ...
网友评论