我最近在虚拟框中安装了 ubuntu 14.04。现在我想在其中安装 g++ 4.7。我正在终端中尝试此命令,但它不起作用。
sudo apt-get install g++-4.7
Reading package list... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package g++-4.7
E: Couldn't find any package by regex 'g++-4.7'
Run Code Online (Sandbox Code Playgroud)
但我发现 gcc 与 Ubuntu 14.04 安装本身一起存在。
我怎么能在 ubuntu 14.04 中安装 g++ 并且任何版本的 g++ 高于 4.7.2 对我来说都很好。
job*_*bin 24
如果您想要最新的软件包,则无需在安装时指定版本。
在终端上执行以下操作:
sudo apt-get update
Run Code Online (Sandbox Code Playgroud)
要使用最新版本的 g++ 更新您的软件包列表,请输入您的密码,然后按Return,然后,
做:
sudo apt-get install g++
Run Code Online (Sandbox Code Playgroud)
安装g++.
您也可以从软件中心安装它。在破折号上键入“软件中心”,然后g++在软件中心打开后在搜索栏中键入,然后单击安装并输入您的密码。