无法在ubuntu 14.04.4 LTS上安装g ++(我试过命令和软件中心)

问题描述 投票:-1回答:2

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

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

cluster@cluster0-vm:~$ 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.

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

cluster@cluster0-vm:~$ 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个来源,所有这些都有问题......天啊!

linux ubuntu g++ apt-get
2个回答
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
投票

如果我不得不猜测,我会说还有其他libc6,libc-dev等等需要更新才能更新C和G的文件。似乎如果您安装build essentials,那么它将解决问题。

如果你查看ubuntu软件包网站上的文件并查看依赖项,然后将它们与你机器上的文件进行比较,我敢打赌你发现由于某些地方不兼容的依赖版本而出现更新冲突。

您可以在存储库页面(一个小表)的底部单独手动下载它们,然后双击deb文件,如果所有依赖项和版本都满足并兼容,它们将开始安装。

可以把它想象成“依赖于依赖于C的B依赖于...... ......”正在安装。无限到无穷无尽。这样做是一场噩梦。但是,是否会迫使您尊重Synaptic以及apt-get彻底和详细的流程和兼容性检查。

最好从构建必需品开始。

© www.soinside.com 2019 - 2024. All rights reserved.