Ubuntu14.04无法安装g++

Ubuntu14.04无法安装g++

我的电脑环境:Ubuntu 14.04,64位操作系统;gcc版本: gcc 版本 4.8.4(Ubuntu 4.8.4-2ubuntu1~14.04)

我尝试通过执行以下命令来安装 g++:

sudo apt-get 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++-4.8 (>= 4.8.2-5~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

我该如何解决这个问题?

答案1

您必须启用trusty-updates。打开并在选项卡中Software & Updates设置粗体trusty-updatesUpdates

在此处输入图片描述

在那之后

sudo apt-get update
sudo apt-get install --reinstall g++

相关内容