2016-03-11 265 views
-1

我无法在新安装的Ubuntu 14.04.4 LTS上安装g ++。无法在ubuntu 14.04.4 LTS上安装g ++

当我使用命令sudo apt-get install g++,终端告诉我:

[email protected]:~$ sudo apt-get install g++ 
[sudo] password for cluster: 
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. 

我改变了来源,并再次尝试,失败了。

[email protected]:~$ 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++:i386 : Depends: cpp:i386 (>= 4:4.7.3-1ubuntu10) but it is not going to be installed 
      Depends: gcc:i386 (>= 4:4.7.3-1ubuntu10) but it is not going to be installed 
      Depends: g++-4.7:i386 (>= 4.7.3-1~) but it is not going to be installed 
      Depends: gcc-4.7:i386 (>= 4.7.3-1~) but it is not going to be installed 
E: Unable to correct problems, you have held broken packages. 

我使用的Ubuntu软件中心安装G ++,又失败了...... Figure: Use ubuntu software center to install g++

这个问题已经通过改变其它来源解决。

我已经尝试了4个来源,并且他们都有问题...... OMG!

+0

查看https://askubuntu.com/questions/118749/package-system-is-broken-how-to-fix-it – sashoalm

回答

1

我认为这将有助于:

sudo apt-get update 
sudo apt-get -f install 
sudo dpkg --configure -a 
sudo apt-get clean 
sudo apt-get install g++ 

而且这可能帮助:

sudo dpkg --purge g++# Try this first 
sudo dpkg --purge --force-depends g++# Try this ONLY if the previous line fails 
sudo apt-get clean g++# Remove g++ from the cache 
sudo apt-get install g++# Download and install the appropriate version of g++ 
+0

它不能解决这个问题...... – xysmlx

+0

你仍然有同样的错误? – alexey

+0

是的,同样的错误。 – xysmlx

0

如果我猜的话,我会说有其他的libc6,的libc-dev的,等等。在更新C和G之前需要更新的文件。如果你在ubuntu软件包网站上查找文件并查看依赖关系,然后将它们与机器上的内容进行比较,我敢打赌,你在未来几天会有更新版本。 您可以手动将它们下载到页面底部(一个小表),然后双击deb文件,如果满足依赖关系,它们将开始安装。

认为它是“A依赖于B,其取决于基于C依赖于d ......”正在安装。