Ubuntu apt-get找不到任何版本的gcc和g ++

时间:2017-06-23 11:40:25

标签: linux ubuntu gcc

我试图在我的Ubuntu虚拟机上编译一些C ++程序,它需要g ++ 4.9及更高版本。但是我发现这台机器上的g ++只有版本4.6.3,所以我尝试用这个命令更新g ++和gcc:

sudo apt-get install gcc='4.9' g++='4.9'

然后又回来了:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Version '4.9' for 'gcc' was not found
E: Version '4.9' for 'g++' was not found

奇怪的是,我尝试了另一个版本4.6,它也返回了相同的单词。

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Version '4.6' for 'gcc' was not found
E: Version '4.6' for 'g++' was not found

我的机器发生了什么事?

1 个答案:

答案 0 :(得分:0)

您需要指向较旧的Ubuntu版本。

他们拥有as seen here for gcc-4.9here for gcc-4.6