2015-11-12 49 views
2

所以,当我第一种类型的G ++在控制台检查,这是发生了什么:克++被显示为已安装后也易于得到安装

[email protected]:~$ g++ 
The program 'g++' is currently not installed. You can install it by typing: 
sudo apt-get install g++ 

至于建议,我安装了G ++(没有sudo易于得到更新和-f在此之前)。

[email protected]:~$ sudo apt-get install g++ 
Reading package lists... Done 
Building dependency tree  
Reading state information... Done 
g++ is already the newest version. 
0 upgraded, 0 newly installed, 0 to remove and 121 not upgraded. 

但是这表明,G ++安装后,也这是我在命令行中得到再次:

[email protected]:~$ g++ 
The program 'g++' is currently not installed. You can install it by typing: 
sudo apt-get install g++ 

请帮帮忙! (我在Ubuntu 14.04上)。

编辑1 (响应评论)

sudo update-alternatives --config g++给出了这样的输出:

update-alternatives: error: no alternatives for g++

+1

试着问上http://askubuntu.com – Adam

+1

可能是'G ++'一些其他版本接手普通版本,然后移除。重新安装'g ++'包可能会修复它。 –

+0

http://askubuntu.com/questions/513349/how-can-i-know-that-i-have-g-installed-in-my-ubuntu –

回答

1

尝试使用

locate /usr/bin/g++ 

{时,这是过时的,使用 须藤updatedb的 }

我的Ubuntu系统目前显示

:~$ locate /usr/bin/g++ 
/usr/bin/g++ 
/usr/bin/g++-4.9 
/usr/bin/g++-5 

下一页使用

ls -lsa /usr/bin/g++ 

矿山显示

0 lrwxrwxrwx 1 root root 5 Aug 1 14:32 /usr/bin/g++ -> g++-5 

所以,我的G ++是简单地安装G ++最新的链接。

也许此链接丢失或安装不正确。

尝试手动设置链接。

但在此之前,请直接调用它。

/usr/bin/g++-5 --version 

我的系统报告

g++-5 (Ubuntu 5.2.1-22ubuntu2) 5.2.1 20151010 
Copyright (C) 2015 Free Software Foundation, Inc. 
This is free software; see the source for copying conditions. There is NO 
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
+0

我只是试图设置g ++的符号链接为g ++ - 4.8。这是问题所在。谢谢。 – AruniRC

-1

期待通过突触,看看是否有相关的G ++任何东西,将其清除。