C++ g++;即使在apt安装后也显示为已安装

C++ g++;即使在apt安装后也显示为已安装,c++,g++,ubuntu-14.04,C++,G++,Ubuntu 14.04,因此,当我第一次在控制台键入g++进行检查时,会发生以下情况: arunirc@fisher:~$ g++ The program 'g++' is currently not installed. You can install it by typing: sudo apt-get install g++ 正如建议的那样,我安装了g++(之前sudo是否获得了update和-f) 但是,即使在它显示安装了g++之后,我在命令行中仍然可以看到: arunirc@fisher:~$ g++ Th

因此,当我第一次在控制台键入g++进行检查时,会发生以下情况:

arunirc@fisher:~$ g++
The program 'g++' is currently not installed. You can install it by typing:
sudo apt-get install g++
正如建议的那样,我安装了g++(之前sudo是否获得了update和-f)

但是,即使在它显示安装了g++之后,我在命令行中仍然可以看到:

arunirc@fisher:~$ g++
The program 'g++' is currently not installed. You can install it by typing:
sudo apt-get install g++
请帮忙!(我在Ubuntu 14.04上)

编辑1 (回应评论)

sudo更新备选方案--config g++
提供以下输出:


更新备选方案:错误:g++没有备选方案

查看Synaptic,看看是否有与g++相关的内容并清除它

尝试使用

 locate /usr/bin/g++
{当此文件过期时,请使用 sudo更新 }

我的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++的链接

可能此链接缺失或安装不正确

尝试手动设置链接

但在这样做之前,直接调用它

i、 e

我的系统报告

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.

试着询问一下,可能是其他版本的
g++
取代了常规版本,然后被删除了。重新安装
g++
程序包可能会修复它。尝试运行
sudo更新选项--config g++
@Slava在问题EDIT@DavidSchwartz中包含了运行该命令的输出。我尝试使用sudo apt get重新安装g++,但没有成功。你指的是重新安装
g++
的不同方式吗?我刚刚尝试将g++的符号链接设置为g++-4.8。这就是问题所在。谢谢
/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.